Skip to content

Commit 975811a

Browse files
committed
Change layout of qhelp example code
1 parent 7136763 commit 975811a

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

javascript/ql/src/Security/CWE-693/InsecureHelmet.qhelp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
</p>
2424

2525
<pre>
26-
extensions:
27-
- addsTo:
28-
pack: codeql/javascript-all
29-
extensible: requiredHelmetSecuritySetting
30-
data:
31-
- name: "frameguard"
26+
extensions:
27+
- addsTo:
28+
pack: codeql/javascript-all
29+
extensible: requiredHelmetSecuritySetting
30+
data:
31+
- name: "frameguard"
3232
</pre>
3333

3434
<p>
@@ -52,36 +52,36 @@
5252
</p>
5353

5454
<pre>
55-
const helmet = require('helmet');
56-
app.use(helmet({
57-
frameguard: false,
58-
contentSecurityPolicy: false
59-
}));
55+
const helmet = require('helmet');
56+
app.use(helmet({
57+
frameguard: false,
58+
contentSecurityPolicy: false
59+
}));
6060
</pre>
6161

6262
<p>
6363
In this example, the defaults are used, which enables frame protection and a default Content Security Policy.
6464
</p>
6565

6666
<pre>
67-
app.use(helmet());
67+
app.use(helmet());
6868
</pre>
6969

7070
<p>
7171
You can also enable a custom Content Security Policy by passing an object to the <code>contentSecurityPolicy</code> key. For example, taken from the <a href="https://helmetjs.github.io/#content-security-policy">Helmet docs</a>:
7272
</p>
7373

7474
<pre>
75-
app.use(
76-
helmet({
77-
contentSecurityPolicy: {
78-
directives: {
79-
"script-src": ["'self'", "example.com"],
80-
"style-src": null,
81-
},
82-
},
83-
})
84-
);
75+
app.use(
76+
helmet({
77+
contentSecurityPolicy: {
78+
directives: {
79+
"script-src": ["'self'", "example.com"],
80+
"style-src": null,
81+
},
82+
},
83+
})
84+
);
8585
</pre>
8686

8787
</example>

0 commit comments

Comments
 (0)