]> granicus.if.org Git - python/commitdiff
Bug #1394565: SimpleHTTPServer now doesn't choke on query paramters
authorGeorg Brandl <georg@python.org>
Fri, 13 Jan 2006 17:05:56 +0000 (17:05 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 13 Jan 2006 17:05:56 +0000 (17:05 +0000)
any more.

Lib/SimpleHTTPServer.py
Misc/NEWS

index eac95cab96a774a873e6978a667d9b91e8256c5a..ea10fb7e927a0b3f12efbf3921563e7e59d7a500 100644 (file)
@@ -14,6 +14,7 @@ import os
 import posixpath
 import BaseHTTPServer
 import urllib
+import urlparse
 import cgi
 import shutil
 import mimetypes
@@ -136,6 +137,8 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
         probably be diagnosed.)
 
         """
+        # abandon query parameters
+        path = urlparse.urlparse(path)[2]
         path = posixpath.normpath(urllib.unquote(path))
         words = path.split('/')
         words = filter(None, words)
index a95774fcec91040c91c3244b5aa656eb6a770c98..be768d361a6a10dadbed9577d3d546d0c96757f8 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -335,6 +335,9 @@ Extension Modules
 Library
 -------
 
+- Bug #1394565: SimpleHTTPServer now doesn't choke on query paramters
+  any more.
+  
 - Bug #1403410: The warnings module now doesn't get confused
   when it can't find out the module name it generates a warning for.