summaryrefslogtreecommitdiff
path: root/Lib/SimpleHTTPServer.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-01-13 17:05:56 +0000
committerGeorg Brandl <georg@python.org>2006-01-13 17:05:56 +0000
commitcfa8c5ef03907b26bd2b01c89ea8784b62738ccd (patch)
tree854d72353d6dfe193bfd1ab79b2226024baaf383 /Lib/SimpleHTTPServer.py
parent9a5795f9d19bf36aec77d1454a284a3f64c2802f (diff)
downloadcpython-cfa8c5ef03907b26bd2b01c89ea8784b62738ccd.tar.gz
Bug #1394565: SimpleHTTPServer now doesn't choke on query paramters
any more.
Diffstat (limited to 'Lib/SimpleHTTPServer.py')
-rw-r--r--Lib/SimpleHTTPServer.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/SimpleHTTPServer.py b/Lib/SimpleHTTPServer.py
index eac95cab96..ea10fb7e92 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
@@ -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)