mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-05 02:29:22 +01:00
httpserver: Fix incorrect path joining
This commit is contained in:
parent
e7824213ae
commit
edb13f65df
@ -941,7 +941,7 @@ class Directory(registry.String):
|
||||
if os.path.isabs(filename):
|
||||
filename = os.path.abspath(filename)
|
||||
selfAbs = os.path.abspath(myself)
|
||||
commonPrefix = os.path.commonprefix([selfAbs, filename])
|
||||
commonPrefix = os.path.commonpath([selfAbs, filename])
|
||||
filename = filename[len(commonPrefix):]
|
||||
elif not os.path.isabs(myself):
|
||||
if filename.startswith(myself):
|
||||
|
@ -337,7 +337,7 @@ class Static(SupyHTTPServerCallback):
|
||||
super(Static, self).__init__()
|
||||
self._mimetype = mimetype
|
||||
def doGetOrHead(self, handler, path, write_content):
|
||||
response = get_template(path)
|
||||
response = get_template(path[1:]) # strip leading /
|
||||
if minisix.PY3:
|
||||
response = response.encode()
|
||||
handler.send_response(200)
|
||||
|
Loading…
Reference in New Issue
Block a user