From 68eb9a37cacbec3e96620047fc36d1c121c54715 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Tue, 10 Jul 2018 03:36:09 +0200 Subject: [PATCH] Strip ending / character when using url as function name --- src/Ui/UiRequest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ui/UiRequest.py b/src/Ui/UiRequest.py index 623fb7da..9807e602 100644 --- a/src/Ui/UiRequest.py +++ b/src/Ui/UiRequest.py @@ -105,7 +105,7 @@ class UiRequest(object): # 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 + func = getattr(self, "action" + path.strip("/"), None) # Check if we have action+request_path function if func: return func() else: @@ -145,7 +145,7 @@ class UiRequest(object): if body: return body else: - func = getattr(self, "action" + path.lstrip("/"), None) # Check if we have action+request_path function + func = getattr(self, "action" + path.strip("/"), None) # Check if we have action+request_path function if func: return func() else: