Add script_nonce for UiConfig plugin

This commit is contained in:
shortcutme 2018-11-26 00:13:58 +01:00
parent 55e2a2fd5d
commit e0756a56a4
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 5 additions and 2 deletions

View File

@ -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):