Commit 249c3c2b authored by Jim Fulton's avatar Jim Fulton

Fixed path normalization code to handle empty paths.

parent f555f80d
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
# attributions are listed in the accompanying credits file. # attributions are listed in the accompanying credits file.
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.23 $'[11:-2] __version__='$Revision: 1.24 $'[11:-2]
from string import join, split, find, rfind, lower, upper from string import join, split, find, rfind, lower, upper
from urllib import quote from urllib import quote
...@@ -234,8 +234,8 @@ class BaseRequest: ...@@ -234,8 +234,8 @@ class BaseRequest:
return response.notFoundError(path) return response.notFoundError(path)
# Cleanup the path list # Cleanup the path list
if path[0]=='/': path=path[1:] if path[:1]=='/': path=path[1:]
if path[-1]=='/': path=path[:-1] if path[-1:]=='/': path=path[:-1]
clean=[] clean=[]
for item in split(path, '/'): for item in split(path, '/'):
if not item or item=='.': if not item or item=='.':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment