summaryrefslogtreecommitdiffstats
path: root/Lib/http
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-04-18 07:16:17 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-04-18 07:16:17 (GMT)
commit791ac54a44c1d8c6ee03a3ef733ce04182b8637c (patch)
tree9b00e2fb683943ff36e4022d2a72409f6ec68272 /Lib/http
parentd2be07e1fdc7e18338efe5c6e1c95eb44f8dd869 (diff)
parentd274b3f1f1e2d8811733fb952c9f18d7da3a376a (diff)
downloadcpython-791ac54a44c1d8c6ee03a3ef733ce04182b8637c.zip
cpython-791ac54a44c1d8c6ee03a3ef733ce04182b8637c.tar.gz
cpython-791ac54a44c1d8c6ee03a3ef733ce04182b8637c.tar.bz2
Issue #26657: Merge http.server fix from 3.5
Diffstat (limited to 'Lib/http')
-rw-r--r--Lib/http/server.py6
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 += '/'