Browse Source

Add script_nonce for UiConfig plugin

shortcutme 5 years ago
parent
commit
e0756a56a4
1 changed files with 5 additions and 2 deletions
  1. 5 2
      plugins/UiConfig/UiConfigPlugin.py

+ 5 - 2
plugins/UiConfig/UiConfigPlugin.py

@@ -22,11 +22,14 @@ class UiRequestPlugin(object):
 
         if not extra_headers:
             extra_headers = {}
-        self.sendHeader(extra_headers=extra_headers)
+
+        script_nonce = self.getScriptNonce()
+
+        self.sendHeader(extra_headers=extra_headers, script_nonce=script_nonce)
         site = self.server.site_manager.get(config.homepage)
         return iter([super(UiRequestPlugin, self).renderWrapper(
             site, path, "uimedia/plugins/uiconfig/config.html",
-            "Config", extra_headers, show_loadingscreen=False
+            "Config", extra_headers, show_loadingscreen=False, script_nonce=script_nonce
         )])
 
     def actionUiMedia(self, path, *args, **kwargs):