diff options
Diffstat (limited to 'Lib/http')
-rw-r--r-- | Lib/http/server.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/http/server.py b/Lib/http/server.py index c1607b3..1f6a62b 100644 --- a/Lib/http/server.py +++ b/Lib/http/server.py @@ -768,9 +768,9 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): words = filter(None, words) path = os.getcwd() for word in words: - drive, word = os.path.splitdrive(word) - head, word = os.path.split(word) - if word in (os.curdir, os.pardir): continue + if os.path.dirname(word) or word in (os.curdir, os.pardir): + # Ignore components that are not a simple file/directory name + continue path = os.path.join(path, word) if trailing_slash: path += '/' |