summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)