]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Moshe Zadka writes: When deploying SimpleHTTPServer, I noticed a
authorGuido van Rossum <guido@python.org>
Tue, 16 Nov 1999 19:04:32 +0000 (19:04 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 16 Nov 1999 19:04:32 +0000 (19:04 +0000)
problem: it does not encode/decode the urls, which is wrong.

Lib/SimpleHTTPServer.py

index fc1824c2a1acddf0ba8c33e1a831c2f637fcb19c..a4517dc0591bbf5170a345b3587c1e8baa12153a 100644 (file)
@@ -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()