diff options
author | thejimmyg <devnull@localhost> | 2006-12-18 18:17:05 +0000 |
---|---|---|
committer | thejimmyg <devnull@localhost> | 2006-12-18 18:17:05 +0000 |
commit | 7b8dc91c464ac3a770140b26d4e6cc351bafba0d (patch) | |
tree | 9b0d5ab321f9b14f8ee6df776bd2dc5f577e0f88 /paste/urlparser.py | |
parent | c676c60355e7fd657116de6c5b6b29ae1974e32f (diff) | |
download | paste-7b8dc91c464ac3a770140b26d4e6cc351bafba0d.tar.gz |
Fixed the paths for to work with Windows
Diffstat (limited to 'paste/urlparser.py')
-rw-r--r-- | paste/urlparser.py | 7 |
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) |