Raise exception on invalid path

This commit is contained in:
shortcutme 2017-02-19 00:51:47 +01:00
parent 22059e71a2
commit 45e2b350a9
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -330,6 +330,9 @@ class UiRequest(object):
if path.endswith("/"):
path = path + "index.html"
if ".." in path:
raise Exception("Invalid path")
match = re.match("/media/(?P<address>[A-Za-z0-9\._-]+)/(?P<inner_path>.*)", path)
if match:
path_parts = match.groupdict()