@@ -30,17 +30,7 @@ const defaultProcessFn = (builtPolicy, htmlPluginData, $) => {
3030 : $ . html ( ) ;
3131} ;
3232
33- var cspHeadersForSourceGlob = [
34- {
35- source : '**/*' ,
36- headers : [
37- {
38- key : 'Content-Security-Policy' ,
39- value : "script-src 'self'" ,
40- } ,
41- ]
42- } ,
43- ] ;
33+ var cspHeadersForSourceGlob = [ ] ;
4434
4535const generateFirebaseJson = (
4636 builtPolicy ,
@@ -49,17 +39,22 @@ const generateFirebaseJson = (
4939 compilation ,
5040) => {
5141 const sourcesGlob = htmlPluginData . outputName
52- . replace ( / i n d e x \. h t m l / , "(index.html)?" )
53- . replace ( / \. h t m l / , "(\\ .html)?" )
54- cspHeadersForSourceGlob = [ {
55- source : `^/ ${ sourcesGlob } $` ,
56- headers : [
42+ . replace ( / 4 0 4 \. h t m l / , '**/*' )
43+ . replace ( / i n d e x \. h t m l / , '(index .html)?' )
44+ . replace ( / \. h t m l / , '(\\.html)?' )
45+ cspHeadersForSourceGlob = cspHeadersForSourceGlob . concat (
46+ [
5747 {
58- key : 'Content-Security-Policy' ,
59- value : builtPolicy ,
60- }
61- ] ,
62- } ] . concat ( cspHeadersForSourceGlob ) ;
48+ source : `^/${ sourcesGlob } $` ,
49+ headers : [
50+ {
51+ key : 'Content-Security-Policy' ,
52+ value : builtPolicy ,
53+ }
54+ ] ,
55+ }
56+ ]
57+ ) ;
6358
6459 transformerFirebase ( cspHeadersForSourceGlob ) ;
6560
0 commit comments