From 7dbc323f762bc5acddff0a0eb727c8736b530df6 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Wed, 4 Oct 2017 12:33:43 +0200 Subject: [PATCH] ZeroNet-internal virtual path on UiServer for internal commands --- src/Ui/UiRequest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Ui/UiRequest.py b/src/Ui/UiRequest.py index d2e4e27f..dcc5497b 100644 --- a/src/Ui/UiRequest.py +++ b/src/Ui/UiRequest.py @@ -87,6 +87,14 @@ class UiRequest(object): return self.actionIndex() elif path == "/favicon.ico": return self.actionFile("src/Ui/media/img/favicon.ico") + # Internal functions + elif "/ZeroNet-Internal/" in path: + path = re.sub(".*?/ZeroNet-Internal/", "/", path) + func = getattr(self, "action" + path.lstrip("/"), None) # Check if we have action+request_path function + if func: + return func() + else: + return self.error404(path) # Media elif path.startswith("/uimedia/"): return self.actionUiMedia(path)