Ensure we don't have any trailing slashes when matching paths in the ftp site pickle.

This commit is contained in:
Dave Page
2016-12-06 13:58:25 +00:00
parent 92dcb0a23d
commit 9d99280bad

View File

@ -54,7 +54,7 @@ def ftpbrowser(request, subpath):
if allnodes[parent][d]['t'] == 'd':
canonpath = os.path.join(canonpath, d)
elif allnodes[parent][d]['t'] == 'l':
canonpath = os.path.join(canonpath, allnodes[parent][d]['d'])
canonpath = os.path.join(canonpath, allnodes[parent][d]['d']).strip('/')
else:
# There's a matching node, but it's not a link or a directory
raise Http404