ZeroNet-internal virtual path on UiServer for internal commands

This commit is contained in:
shortcutme 2017-10-04 12:33:43 +02:00
parent 903b62ba7c
commit 7dbc323f76
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

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