Mercurial > cpython-lru_cache-weakref
diff Lib/SimpleHTTPServer.py @ 36280:da0995ca1f30 2.4
Bug #1394565: SimpleHTTPServer now doesn't choke on query paramters
any more.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Fri, 13 Jan 2006 17:06:02 +0000 |
| parents | dee253a3116c |
| children | 03c05cab5f21 |
line wrap: on
line diff
--- a/Lib/SimpleHTTPServer.py Fri Jan 13 16:59:54 2006 +0000 +++ b/Lib/SimpleHTTPServer.py Fri Jan 13 17:06:02 2006 +0000 @@ -14,6 +14,7 @@ import posixpath import BaseHTTPServer import urllib +import urlparse import cgi import shutil import mimetypes @@ -132,6 +133,8 @@ probably be diagnosed.) """ + # abandon query parameters + path = urlparse.urlparse(path)[2] path = posixpath.normpath(urllib.unquote(path)) words = path.split('/') words = filter(None, words)
