summaryrefslogtreecommitdiff
path: root/paste/urlparser.py
diff options
context:
space:
mode:
authorthejimmyg <devnull@localhost>2006-12-18 18:17:05 +0000
committerthejimmyg <devnull@localhost>2006-12-18 18:17:05 +0000
commit7b8dc91c464ac3a770140b26d4e6cc351bafba0d (patch)
tree9b0d5ab321f9b14f8ee6df776bd2dc5f577e0f88 /paste/urlparser.py
parentc676c60355e7fd657116de6c5b6b29ae1974e32f (diff)
downloadpaste-7b8dc91c464ac3a770140b26d4e6cc351bafba0d.tar.gz
Fixed the paths for to work with Windows
Diffstat (limited to 'paste/urlparser.py')
-rw-r--r--paste/urlparser.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/paste/urlparser.py b/paste/urlparser.py
index 1e27a05..f096c1b 100644
--- a/paste/urlparser.py
+++ b/paste/urlparser.py
@@ -436,7 +436,10 @@ class StaticURLParser(object):
else:
self.root_directory = directory
self.cache_max_age = cache_max_age
-
+ if os.path.sep != '/':
+ directory = directory.replace('/', os.path.sep)
+ self.root_directory = self.root_directory.replace('/', os.path.sep)
+
def __call__(self, environ, start_response):
path_info = environ.get('PATH_INFO', '')
if not path_info:
@@ -447,6 +450,8 @@ class StaticURLParser(object):
else:
filename = request.path_info_pop(environ)
full = 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):
# Out of bounds
return self.not_found(environ, start_response)