Ensure we don't have any trailing slashes when matching paths in the ftp site pickle.
authorDave Page <dpage@pgadmin.org>
Tue, 6 Dec 2016 13:58:25 +0000 (13:58 +0000)
committerDave Page <dpage@pgadmin.org>
Tue, 6 Dec 2016 13:58:25 +0000 (13:58 +0000)
pgweb/downloads/views.py

index d15810d7a3bd1ce39ac67ea01c14fb0b798ee6e8..da29f3aabc3bfa612ec3035554e5181302e9936e 100644 (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