Skip to content

Commit 7dfb404

Browse files
committed
clean examples
1 parent e85987b commit 7dfb404

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

javascript/ql/src/Security/CWE-798/examples/HardcodedCredentialsHttpRequest.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ let password = 'passwd';
66

77
let headers = new Headers();
88

9-
//headers.append('Content-Type', 'text/json');
9+
headers.append('Content-Type', 'text/json');
1010
headers.append('Authorization', 'Basic' + base64.encode(username + ":" + password));
1111

12-
fetch(url, {method:'GET',
13-
headers: headers,
14-
credentials: `${user}:${passwd}`
12+
fetch(url, {
13+
method:'GET',
14+
headers: headers
1515
})
1616
.then(response => response.json())
17-
.then(json => console.log(json));
17+
.then(json => console.log(json))
1818
.done();

javascript/ql/src/Security/CWE-798/examples/HardcodedCredentialsHttpRequestFixed.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ let password = process.env.PASSWORD;
66

77
let headers = new Headers();
88

9-
//headers.append('Content-Type', 'text/json');
9+
headers.append('Content-Type', 'text/json');
1010
headers.append('Authorization', 'Basic' + base64.encode(username + ":" + password));
1111

12-
fetch(url, {method:'GET',
13-
headers: headers,
14-
credentials: `${user}:${passwd}`
15-
})
12+
fetch(url, {
13+
method:'GET',
14+
headers: headers
15+
})
1616
.then(response => response.json())
17-
.then(json => console.log(json));
17+
.then(json => console.log(json))
1818
.done();

0 commit comments

Comments
 (0)