@@ -714,7 +714,7 @@ def _generate_scripts_html(self):
714
714
)
715
715
)
716
716
717
- global_inline_scripts = list (_callback .GLOBAL_INLINE_SCRIPTS )
717
+ self . _inline_scripts . extend (_callback .GLOBAL_INLINE_SCRIPTS )
718
718
_callback .GLOBAL_INLINE_SCRIPTS .clear ()
719
719
720
720
return "\n " .join (
@@ -724,10 +724,7 @@ def _generate_scripts_html(self):
724
724
else '<script src="{}"></script>' .format (src )
725
725
for src in srcs
726
726
]
727
- + [
728
- "<script>{}</script>" .format (src )
729
- for src in (self ._inline_scripts + global_inline_scripts )
730
- ]
727
+ + ["<script>{}</script>" .format (src ) for src in self ._inline_scripts ]
731
728
)
732
729
733
730
def _generate_config_html (self ):
@@ -1438,16 +1435,17 @@ def csp_hashes(self, hash_algorithm="sha256"):
1438
1435
1439
1436
method = getattr (hashlib , hash_algorithm )
1440
1437
1438
+ self ._inline_scripts .extend (_callback .GLOBAL_INLINE_SCRIPTS )
1439
+ _callback .GLOBAL_INLINE_SCRIPTS .clear ()
1440
+
1441
1441
return [
1442
1442
"'{hash_algorithm}-{base64_hash}'" .format (
1443
1443
hash_algorithm = hash_algorithm ,
1444
1444
base64_hash = base64 .b64encode (
1445
1445
method (script .encode ("utf-8" )).digest ()
1446
1446
).decode ("utf-8" ),
1447
1447
)
1448
- for script in (
1449
- self ._inline_scripts + [self .renderer ] + _callback .GLOBAL_INLINE_SCRIPTS
1450
- )
1448
+ for script in (self ._inline_scripts + [self .renderer ])
1451
1449
]
1452
1450
1453
1451
def get_asset_url (self , path ):
0 commit comments