Bug #1394565: SimpleHTTPServer now doesn't choke on query paramters
any more.
This commit is contained in:
parent
4edd989eaf
commit
45ab233935
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue