@@ -57,6 +57,45 @@ function contentSecurityPolicyTest() {
57
57
disableAndroid : false
58
58
} ;
59
59
60
+ const configWithBooleanSandbox : fastifyHelmet . IHelmetContentSecurityPolicyConfiguration = {
61
+ directives : {
62
+ baseUri : [ "base.example.com" ] ,
63
+ blockAllMixedContent : true ,
64
+ childSrc : [ "child.example.com" ] ,
65
+ connectSrc : [ "connect.example.com" ] ,
66
+ defaultSrc : [ "*" ] ,
67
+ fontSrc : [ "font.example.com" ] ,
68
+ formAction : [ "formaction.example.com" ] ,
69
+ frameAncestors : [ "'none'" ] ,
70
+ frameSrc : emptyArray ,
71
+ imgSrc : [ "images.example.com" ] ,
72
+ mediaSrc : [ "media.example.com" ] ,
73
+ manifestSrc : [ "manifest.example.com" ] ,
74
+ objectSrc : [ "objects.example.com" ] ,
75
+ pluginTypes : emptyArray ,
76
+ prefetchSrc : [ "prefetch.example.com" ] ,
77
+ reportUri : "/some-url" ,
78
+ reportTo : "report.example.com" ,
79
+ requireSriFor : emptyArray ,
80
+ sandbox : true ,
81
+ scriptSrc : [
82
+ "scripts.example.com" ,
83
+ function (
84
+ req : fastify . FastifyRequest < http . IncomingMessage > ,
85
+ res : fastify . FastifyReply < http . ServerResponse >
86
+ ) {
87
+ return "'nonce-abc123'" ;
88
+ }
89
+ ] ,
90
+ styleSrc : [ "css.example.com" ] ,
91
+ upgradeInsecureRequests : true ,
92
+ workerSrc : [ "worker.example.com" ]
93
+ } ,
94
+ reportOnly : false ,
95
+ setAllHeaders : false ,
96
+ disableAndroid : false
97
+ } ;
98
+
60
99
function reportUriCb (
61
100
req : fastify . FastifyRequest < http . IncomingMessage > ,
62
101
res : fastify . FastifyReply < http . ServerResponse >
0 commit comments