summaryrefslogtreecommitdiff
path: root/paste/urlparser.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2008-04-18 21:27:28 +0000
committerianb <devnull@localhost>2008-04-18 21:27:28 +0000
commit35876f52585996786000c8317ae93b581af3c7a9 (patch)
treef836c12253a431a0de958c1243a56efbeaa8fa89 /paste/urlparser.py
parent31317715886591a64681f4cc0cee1aaaf88d0896 (diff)
downloadpaste-35876f52585996786000c8317ae93b581af3c7a9.tar.gz
Fix case normalization on Windows
Diffstat (limited to 'paste/urlparser.py')
-rw-r--r--paste/urlparser.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/paste/urlparser.py b/paste/urlparser.py
index 2f79796..d508b77 100644
--- a/paste/urlparser.py
+++ b/paste/urlparser.py
@@ -454,7 +454,8 @@ class StaticURLParser(object):
filename = 'index.html'
else:
filename = request.path_info_pop(environ)
- full = os.path.normpath(os.path.join(self.directory, filename))
+ full = os.path.normcase(os.path.normpath(
+ os.path.join(self.directory, filename))))
if os.path.sep != '/':
full = full.replace('/', os.path.sep)
if self.root_directory is not None and not full.startswith(self.root_directory):
@@ -564,7 +565,8 @@ class PkgResourcesParser(StaticURLParser):
filename = 'index.html'
else:
filename = request.path_info_pop(environ)
- resource = os.path.normpath(self.resource_name + '/' + filename)
+ resource = os.path.normcase(os.path.normpath(
+ self.resource_name + '/' + filename))
if self.root_resource is not None and not resource.startswith(self.root_resource):
# Out of bounds
return self.not_found(environ, start_response)