Strip ending / character when using url as function name
This commit is contained in:
parent
6c4ce03d59
commit
68eb9a37ca
1 changed files with 2 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue