@@ -66,7 +66,7 @@ public void writeContentSecurityPolicyHeader() {
66
66
@ Test
67
67
public void onIndexPageWithLocalResources () {
68
68
ContentSecurityPolicyHeaderWriter writer =
69
- new ContentSecurityPolicyHeaderWriter (true , bool (), SiteUrl .SITE );
69
+ new ContentSecurityPolicyHeaderWriter (false , bool (), SiteUrl .SITE );
70
70
String [] directives = writer .constructDirectives ("/" ).split (";" );
71
71
72
72
assertThat (directives , hasItemInArray ("default-src 'none'" ));
@@ -92,7 +92,7 @@ public void onIndexPageWithLocalResources() {
92
92
@ Test
93
93
public void onIndexPageWithResourcesFromCdn () {
94
94
ContentSecurityPolicyHeaderWriter writer
95
- = new ContentSecurityPolicyHeaderWriter (false , bool (), SiteUrl .PUBLIC_URL );
95
+ = new ContentSecurityPolicyHeaderWriter (true , bool (), SiteUrl .PUBLIC_URL );
96
96
String [] directives = writer .constructDirectives ("/" ).split (";" );
97
97
98
98
assertThat (directives , hasItemInArray ("default-src 'none'" ));
@@ -136,7 +136,7 @@ public void onIndexPageWithResourcesFromCdn() {
136
136
@ Test
137
137
public void onCollectionInfoPageWithLocalResources () {
138
138
ContentSecurityPolicyHeaderWriter writer =
139
- new ContentSecurityPolicyHeaderWriter (true , bool (), Random .host ());
139
+ new ContentSecurityPolicyHeaderWriter (false , bool (), Random .host ());
140
140
String [] directives = writer .constructDirectives ("/collection/user" ).split (";" );
141
141
142
142
// test only the directives that differ from the index page
@@ -169,7 +169,7 @@ public void onCollectionInfoPageWithLocalResources() {
169
169
@ Test
170
170
public void onCollectionInfoPageWithResourcesFromCdn () {
171
171
ContentSecurityPolicyHeaderWriter writer =
172
- new ContentSecurityPolicyHeaderWriter (false , bool (), Random .host ());
172
+ new ContentSecurityPolicyHeaderWriter (true , bool (), Random .host ());
173
173
String [] directives = writer .constructDirectives ("/collection/user" ).split (";" );
174
174
175
175
// test only the directives that differ from the index page
@@ -205,7 +205,7 @@ public void onCollectionInfoPageWithResourcesFromCdn() {
205
205
@ Test
206
206
public void onSeriesAddImagePageWithLocalResources () {
207
207
ContentSecurityPolicyHeaderWriter writer =
208
- new ContentSecurityPolicyHeaderWriter (true , bool (), Random .host ());
208
+ new ContentSecurityPolicyHeaderWriter (false , bool (), Random .host ());
209
209
210
210
for (String page : new String []{"/series/11" , "/series/12/ask" , "/series/13/image" }) {
211
211
String [] directives = writer .constructDirectives (page ).split (";" );
@@ -231,7 +231,7 @@ public void onSeriesAddImagePageWithLocalResources() {
231
231
@ Test
232
232
public void onSeriesAddImagePageWithResourcesFromCdn () {
233
233
ContentSecurityPolicyHeaderWriter writer =
234
- new ContentSecurityPolicyHeaderWriter (false , bool (), Random .host ());
234
+ new ContentSecurityPolicyHeaderWriter (true , bool (), Random .host ());
235
235
236
236
for (String page : new String []{"/series/11" , "/series/12/ask" , "/series/13/image" }) {
237
237
String [] directives = writer .constructDirectives (page ).split (";" );
@@ -270,7 +270,7 @@ public void onSeriesAddImagePageWithResourcesFromCdn() {
270
270
@ Test
271
271
public void onSeriesAddPageWithLocalResources () {
272
272
ContentSecurityPolicyHeaderWriter writer =
273
- new ContentSecurityPolicyHeaderWriter (true , bool (), Random .host ());
273
+ new ContentSecurityPolicyHeaderWriter (false , bool (), Random .host ());
274
274
String [] directives = writer .constructDirectives ("/series/add" ).split (";" );
275
275
276
276
// test only the directives that differ from the index page
@@ -304,7 +304,7 @@ public void onSeriesAddPageWithLocalResources() {
304
304
@ Test
305
305
public void onSeriesAddPageWithResourcesFromCdn () {
306
306
ContentSecurityPolicyHeaderWriter writer =
307
- new ContentSecurityPolicyHeaderWriter (false , bool (), Random .host ());
307
+ new ContentSecurityPolicyHeaderWriter (true , bool (), Random .host ());
308
308
String [] directives = writer .constructDirectives ("/series/add" ).split (";" );
309
309
310
310
// test only the directives that differ from the index page
@@ -341,7 +341,7 @@ public void onSeriesAddPageWithResourcesFromCdn() {
341
341
@ Test
342
342
public void onH2ConsoleWithLocalResources () {
343
343
ContentSecurityPolicyHeaderWriter writer =
344
- new ContentSecurityPolicyHeaderWriter (true , true , Random .host ());
344
+ new ContentSecurityPolicyHeaderWriter (false , true , Random .host ());
345
345
String [] directives = writer .constructDirectives ("/console/" ).split (";" );
346
346
347
347
// test only the directives that are differ from the index page
@@ -376,7 +376,7 @@ public void onH2ConsoleWithLocalResources() {
376
376
@ Test
377
377
public void onH2ConsoleWithResourcesFromCdn () {
378
378
ContentSecurityPolicyHeaderWriter writer =
379
- new ContentSecurityPolicyHeaderWriter (false , false , Random .host ());
379
+ new ContentSecurityPolicyHeaderWriter (true , false , Random .host ());
380
380
String [] directives = writer .constructDirectives ("/console/" ).split (";" );
381
381
382
382
// "style-src" directive should be the same as for the index page
0 commit comments