MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / actionWrapper

Method actionWrapper

plugins/UiConfig/UiConfigPlugin.py:18–32  ·  view source on GitHub ↗
(self, path, extra_headers=None)

Source from the content-addressed store, hash-verified

16@PluginManager.registerTo("UiRequest")
17class UiRequestPlugin(object):
18 def actionWrapper(self, path, extra_headers=None):
19 if path.strip("/") != "Config":
20 return super(UiRequestPlugin, self).actionWrapper(path, extra_headers)
21
22 if not extra_headers:
23 extra_headers = {}
24
25 script_nonce = self.getScriptNonce()
26
27 self.sendHeader(extra_headers=extra_headers, script_nonce=script_nonce)
28 site = self.server.site_manager.get(config.homepage)
29 return iter([super(UiRequestPlugin, self).renderWrapper(
30 site, path, "uimedia/plugins/uiconfig/config.html",
31 "Config", extra_headers, show_loadingscreen=False, script_nonce=script_nonce
32 )])
33
34 def actionUiMedia(self, path, *args, **kwargs):
35 if path.startswith("/uimedia/plugins/uiconfig/"):

Callers

nothing calls this directly

Calls 4

getScriptNonceMethod · 0.80
sendHeaderMethod · 0.80
getMethod · 0.45
renderWrapperMethod · 0.45

Tested by

no test coverage detected