From: Georg Brandl Date: Fri, 13 Jan 2006 17:06:02 +0000 (+0000) Subject: Bug #1394565: SimpleHTTPServer now doesn't choke on query paramters X-Git-Tag: v2.4.3c1~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d901f75c552a6e47ab80064419c40aff9dda3468;p=thirdparty%2FPython%2Fcpython.git Bug #1394565: SimpleHTTPServer now doesn't choke on query paramters any more. --- diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py index 4b27d17005d1..fe0c46653f4a 100644 --- a/Lib/SimpleHTTPServer.py +++ b/Lib/SimpleHTTPServer.py @@ -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) diff --git a/Misc/NEWS b/Misc/NEWS index ca9317163a21..b1a938b9be85 100644 --- 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.