mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Moshe Zadka writes: When deploying SimpleHTTPServer, I noticed a
problem: it does not encode/decode the urls, which is wrong.
This commit is contained in:
parent
ed7f9e2425
commit
d7b147b040
1 changed files with 2 additions and 1 deletions
|
@ -13,6 +13,7 @@ import os
|
|||
import string
|
||||
import posixpath
|
||||
import BaseHTTPServer
|
||||
import urllib
|
||||
|
||||
|
||||
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||
|
@ -77,7 +78,7 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
|||
probably be diagnosed.)
|
||||
|
||||
"""
|
||||
path = posixpath.normpath(path)
|
||||
path = posixpath.normpath(urllib.unquote(path))
|
||||
words = string.splitfields(path, '/')
|
||||
words = filter(None, words)
|
||||
path = os.getcwd()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue