From: Guido van Rossum Date: Tue, 16 Nov 1999 19:04:32 +0000 (+0000) Subject: Moshe Zadka writes: When deploying SimpleHTTPServer, I noticed a X-Git-Tag: v1.6a1~731 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7b147b040140b0c901c15c795ea1172b3c2a546;p=thirdparty%2FPython%2Fcpython.git Moshe Zadka writes: When deploying SimpleHTTPServer, I noticed a problem: it does not encode/decode the urls, which is wrong. --- diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py index fc1824c2a1ac..a4517dc0591b 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()