]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Bug #1394565: SimpleHTTPServer now doesn't choke on query paramters
authorGeorg Brandl <georg@python.org>
Fri, 13 Jan 2006 17:06:02 +0000 (17:06 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 13 Jan 2006 17:06:02 +0000 (17:06 +0000)
any more.

Lib/SimpleHTTPServer.py
Misc/NEWS

index 4b27d17005d18291a91bb6821ae429e8996ab759..fe0c46653f4a81bf7d389f3ad353d9d9739f7df1 100644 (file)
@@ -14,6 +14,7 @@ import os
 import posixpath
 import BaseHTTPServer
 import urllib
+import urlparse
 import cgi
 import shutil
 import mimetypes
@@ -132,6 +133,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 ca9317163a215734b54d7a7bb4985507d310abce..b1a938b9be857c615b7619a013c98185ef48c39c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -68,6 +68,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.