@@ -54,7 +54,7 @@ app.use(
54
54
" script-src" : [" 'self'" , " example.com" ],
55
55
},
56
56
},
57
- })
57
+ }),
58
58
);
59
59
```
60
60
@@ -67,7 +67,7 @@ app.use(
67
67
helmet ({
68
68
contentSecurityPolicy: false ,
69
69
xDownloadOptions: false ,
70
- })
70
+ }),
71
71
);
72
72
```
73
73
@@ -99,7 +99,7 @@ app.use(
99
99
" style-src" : null ,
100
100
},
101
101
},
102
- })
102
+ }),
103
103
);
104
104
```
105
105
@@ -117,7 +117,7 @@ app.use(
117
117
scriptSrc: [" 'self'" , (req , res ) => ` 'nonce-${ res .locals .cspNonce } '` ],
118
118
},
119
119
},
120
- })
120
+ }),
121
121
);
122
122
```
123
123
@@ -138,7 +138,7 @@ app.use(
138
138
upgradeInsecureRequests: [],
139
139
},
140
140
},
141
- })
141
+ }),
142
142
);
143
143
```
144
144
@@ -172,7 +172,7 @@ app.use(
172
172
},
173
173
reportOnly: true ,
174
174
},
175
- })
175
+ }),
176
176
);
177
177
```
178
178
@@ -184,7 +184,7 @@ To disable the `Content-Security-Policy` header:
184
184
app .use (
185
185
helmet ({
186
186
contentSecurityPolicy: false ,
187
- })
187
+ }),
188
188
);
189
189
```
190
190
@@ -234,7 +234,7 @@ app.use(helmet());
234
234
app .use (
235
235
helmet ({
236
236
crossOriginOpenerPolicy: { policy: " same-origin-allow-popups" },
237
- })
237
+ }),
238
238
);
239
239
```
240
240
@@ -244,7 +244,7 @@ To disable the `Cross-Origin-Opener-Policy` header:
244
244
app .use (
245
245
helmet ({
246
246
crossOriginOpenerPolicy: false ,
247
- })
247
+ }),
248
248
);
249
249
```
250
250
@@ -277,7 +277,7 @@ To disable the `Cross-Origin-Resource-Policy` header:
277
277
app .use (
278
278
helmet ({
279
279
crossOriginResourcePolicy: false ,
280
- })
280
+ }),
281
281
);
282
282
```
283
283
@@ -309,7 +309,7 @@ To disable the `Origin-Agent-Cluster` header:
309
309
app .use (
310
310
helmet ({
311
311
originAgentCluster: false ,
312
- })
312
+ }),
313
313
);
314
314
```
315
315
@@ -342,7 +342,7 @@ app.use(
342
342
referrerPolicy: {
343
343
policy: " no-referrer" ,
344
344
},
345
- })
345
+ }),
346
346
);
347
347
348
348
// Sets "Referrer-Policy: origin,unsafe-url"
@@ -351,7 +351,7 @@ app.use(
351
351
referrerPolicy: {
352
352
policy: [" origin" , " unsafe-url" ],
353
353
},
354
- })
354
+ }),
355
355
);
356
356
```
357
357
@@ -361,7 +361,7 @@ To disable the `Referrer-Policy` header:
361
361
app .use (
362
362
helmet ({
363
363
referrerPolicy: false ,
364
- })
364
+ }),
365
365
);
366
366
```
367
367
@@ -398,7 +398,7 @@ app.use(
398
398
strictTransportSecurity: {
399
399
maxAge: 123456 ,
400
400
},
401
- })
401
+ }),
402
402
);
403
403
404
404
// Sets "Strict-Transport-Security: max-age=123456"
@@ -408,7 +408,7 @@ app.use(
408
408
maxAge: 123456 ,
409
409
includeSubDomains: false ,
410
410
},
411
- })
411
+ }),
412
412
);
413
413
414
414
// Sets "Strict-Transport-Security: max-age=123456; includeSubDomains; preload"
@@ -418,7 +418,7 @@ app.use(
418
418
maxAge: 63072000 ,
419
419
preload: true ,
420
420
},
421
- })
421
+ }),
422
422
);
423
423
```
424
424
@@ -428,7 +428,7 @@ To disable the `Strict-Transport-Security` header:
428
428
app .use (
429
429
helmet ({
430
430
strictTransportSecurity: false ,
431
- })
431
+ }),
432
432
);
433
433
```
434
434
@@ -460,7 +460,7 @@ To disable the `X-Content-Type-Options` header:
460
460
app .use (
461
461
helmet ({
462
462
xContentTypeOptions: false ,
463
- })
463
+ }),
464
464
);
465
465
```
466
466
@@ -493,14 +493,14 @@ Examples:
493
493
app .use (
494
494
helmet ({
495
495
xDnsPrefetchControl: { allow: false },
496
- })
496
+ }),
497
497
);
498
498
499
499
// Sets "X-DNS-Prefetch-Control: on"
500
500
app .use (
501
501
helmet ({
502
502
xDnsPrefetchControl: { allow: true },
503
- })
503
+ }),
504
504
);
505
505
```
506
506
@@ -510,7 +510,7 @@ To disable the `X-DNS-Prefetch-Control` header and use the browser's default val
510
510
app .use (
511
511
helmet ({
512
512
xDnsPrefetchControl: false ,
513
- })
513
+ }),
514
514
);
515
515
```
516
516
@@ -542,7 +542,7 @@ To disable the `X-Download-Options` header:
542
542
app .use (
543
543
helmet ({
544
544
xDownloadOptions: false ,
545
- })
545
+ }),
546
546
);
547
547
```
548
548
@@ -575,14 +575,14 @@ Examples:
575
575
app .use (
576
576
helmet ({
577
577
xFrameOptions: { action: " deny" },
578
- })
578
+ }),
579
579
);
580
580
581
581
// Sets "X-Frame-Options: SAMEORIGIN"
582
582
app .use (
583
583
helmet ({
584
584
xFrameOptions: { action: " sameorigin" },
585
- })
585
+ }),
586
586
);
587
587
```
588
588
@@ -592,7 +592,7 @@ To disable the `X-Frame-Options` header:
592
592
app .use (
593
593
helmet ({
594
594
xFrameOptions: false ,
595
- })
595
+ }),
596
596
);
597
597
```
598
598
@@ -627,7 +627,7 @@ app.use(
627
627
xPermittedCrossDomainPolicies: {
628
628
permittedPolicies: " none" ,
629
629
},
630
- })
630
+ }),
631
631
);
632
632
633
633
// Sets "X-Permitted-Cross-Domain-Policies: by-content-type"
@@ -636,7 +636,7 @@ app.use(
636
636
xPermittedCrossDomainPolicies: {
637
637
permittedPolicies: " by-content-type" ,
638
638
},
639
- })
639
+ }),
640
640
);
641
641
```
642
642
@@ -646,7 +646,7 @@ To disable the `X-Permitted-Cross-Domain-Policies` header:
646
646
app .use (
647
647
helmet ({
648
648
xPermittedCrossDomainPolicies: false ,
649
- })
649
+ }),
650
650
);
651
651
```
652
652
@@ -675,7 +675,7 @@ app.disable("x-powered-by");
675
675
app .use (
676
676
helmet ({
677
677
xPoweredBy: false ,
678
- })
678
+ }),
679
679
);
680
680
```
681
681
@@ -703,7 +703,7 @@ To disable the `X-XSS-Protection` header:
703
703
app .use (
704
704
helmet ({
705
705
xXssProtection: false ,
706
- })
706
+ }),
707
707
);
708
708
```
709
709
0 commit comments