summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-11-16 19:04:32 +0000
committerGuido van Rossum <guido@python.org>1999-11-16 19:04:32 +0000
commit8b1d7b84ffdadada29fb86aad32bdcd4d14aed44 (patch)
tree07efe7a7d1c68d2bffacb40daad3021869ae1580 /Lib
parenta78ce9e602dcb0fd26ad038c5d2624a2605765cd (diff)
downloadcpython-8b1d7b84ffdadada29fb86aad32bdcd4d14aed44.tar.gz
Moshe Zadka writes: When deploying SimpleHTTPServer, I noticed a
problem: it does not encode/decode the urls, which is wrong.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/SimpleHTTPServer.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py
index fc1824c2a1..a4517dc059 100644
--- a/Lib/SimpleHTTPServer.py
+++ b/Lib/SimpleHTTPServer.py
@@ -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()