Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit 474fe7b

Browse files
author
leticiawanderley
committed
Merge remote-tracking branch 'upstream/master'
2 parents d38d75a + ec8d845 commit 474fe7b

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

comments.json

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,19 @@
1010
"text": "React is *great*!"
1111
},
1212
{
13-
"id": 1466760920344,
14-
"author": "Leticia",
15-
"text": "Test"
13+
"id": 1464988635157,
14+
"author": "ben",
15+
"text": "*abc*"
1616
},
1717
{
18-
"id": 1466762939294,
19-
"author": "SDKJSLKGJ",
20-
"text": "sjfklgjs"
18+
"id": 1464988636500,
19+
"author": "ben",
20+
"text": "*abc*"
2121
},
2222
{
23-
"id": 1466778761498,
24-
"author": "dfgdg",
25-
"text": "dafg"
26-
},
27-
{
28-
"id": 1466778933070,
29-
"author": "dghl",
30-
"text": ";lkrg"
23+
"id": 1464988717637,
24+
"author": "evil",
25+
"text": "<a href=\"javascript:alert(1)\">alert(1)</a>"
26+
>>>>>>> upstream/master
3127
}
3228
]

public/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<title>React Tutorial</title>
66
<!-- Not present in the tutorial. Just for basic styling. -->
77
<link rel="stylesheet" href="css/base.css" />
8-
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.js"></script>
9-
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.js"></script>
10-
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.16/browser.js"></script>
11-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
12-
<script src="https://cdnjs.cloudflare.com/ajax/libs/remarkable/1.6.2/remarkable.min.js"></script>
8+
<script src="https://unpkg.com/react@15.3.0/dist/react.js"></script>
9+
<script src="https://unpkg.com/react-dom@15.3.0/dist/react-dom.js"></script>
10+
<script src="https://unpkg.com/babel-[email protected]/babel.min.js"></script>
11+
<script src="https://unpkg.com/jquery@3.1.0/dist/jquery.min.js"></script>
12+
<script src="https://unpkg.com/remarkable@1.7.1/dist/remarkable.min.js"></script>
1313
</head>
1414
<body>
1515
<div id="content"></div>

server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727

2828
function routeRequest()
2929
{
30-
$comments = file_get_contents('comments.json');
3130
$uri = $_SERVER['REQUEST_URI'];
3231
if ($uri == '/') {
3332
echo file_get_contents('./public/index.html');
3433
} elseif (preg_match('/\/api\/comments(\?.*)?/', $uri)) {
34+
$comments = file_get_contents('comments.json');
3535
if($_SERVER['REQUEST_METHOD'] === 'POST') {
3636
$commentsDecoded = json_decode($comments, true);
3737
$commentsDecoded[] = [

server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ def comments_handler():
4141

4242

4343
if __name__ == '__main__':
44-
app.run(port=int(os.environ.get("PORT", 3000)))
44+
app.run(port=int(os.environ.get("PORT", 3000)), debug=True)

0 commit comments

Comments
 (0)