Skip to content

Commit df65d97

Browse files
fix syntax
1 parent e986d8a commit df65d97

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

CWE-834/main.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
const main = async () => {
2-
const response = await fetch('/api', (req, res) => {
3-
const result = req.body
4-
5-
for (let i = 0; i < result.length; i++) {
6-
console.log('Potential Denial of Service attack.')
7-
}
2+
const response = await fetch('/api', {
3+
method: 'GET',
84
})
95

10-
return response.json()
6+
const result = await response.json()
7+
8+
for (let i = 0; i < result.length; i++) {
9+
console.log('Potential Denial of Service attack.')
10+
}
11+
12+
return result
1113
}

0 commit comments

Comments
 (0)