Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed sub directory navigation in weltmeister

  • Loading branch information...
commit 2009d375bc4d383c66175f2c4c696083335dbe6a 1 parent 4593b80
@amadeus authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 server.py
View
13 server.py
@@ -128,13 +128,16 @@ def save(self):
def browse(self):
# Get the directory to scan
- dir = self.query_params['dir'][0] if 'dir' in self.query_params else '.'
- dir = dir.replace('..', '')
- if dir[-1] != '/':
- dir += '/'
+ dir = ''
+ if 'dir' in self.query_params:
+ dir = self.query_params['dir'][0].replace('..', '')
+ if dir[-1] != '/':
+ dir += '/'
# Get the dir and files
- dirs = [d for d in os.listdir(os.path.join(BASE_DIR, dir)) if '.' not in d]
+ dirs = [os.path.join(dir, d) for d in os.listdir(os.path.join(BASE_DIR, dir))
+ if os.path.isdir(os.path.join(dir, d))]
+
files = glob.glob(dir + '*.*')
# Filter on file types
Please sign in to comment.
Something went wrong with that request. Please try again.