mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Issue #26657: Merge http.server fix from 3.5
This commit is contained in:
commit
791ac54a44
3 changed files with 26 additions and 3 deletions
|
@ -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 += '/'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue