diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2010-07-25 19:53:20 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2010-07-25 19:53:20 (GMT) |
commit | 2c4973dd4a08be5aba88726b5872c95d3069c34b (patch) | |
tree | 71f63b133b9b5763f654e1ea79dfad49183959af /Lib/http | |
parent | 85edadb8ab9b7219aaaeaa16a442f672b80e03aa (diff) | |
download | cpython-2c4973dd4a08be5aba88726b5872c95d3069c34b.zip cpython-2c4973dd4a08be5aba88726b5872c95d3069c34b.tar.gz cpython-2c4973dd4a08be5aba88726b5872c95d3069c34b.tar.bz2 |
Merged revisions 82985 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r82985 | gregory.p.smith | 2010-07-19 16:17:22 -0700 (Mon, 19 Jul 2010) | 3 lines
Fixes Issue #3704: http.cookiejar was not properly handling URLs with a / in
the parameters. (This is jjlee's issue3704.patch ported to py3k)
........
Diffstat (limited to 'Lib/http')
-rw-r--r-- | Lib/http/cookiejar.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py index e9efab8..2604817 100644 --- a/Lib/http/cookiejar.py +++ b/Lib/http/cookiejar.py @@ -603,17 +603,14 @@ def eff_request_host(request): return req_host, erhn def request_path(request): - """request-URI, as defined by RFC 2965.""" + """Path component of request-URI, as defined by RFC 2965.""" url = request.get_full_url() - path, parameters, query, frag = urllib.parse.urlparse(url)[2:] - if parameters: - path = "%s;%s" % (path, parameters) - path = escape_path(path) - req_path = urllib.parse.urlunparse(("", "", path, "", query, frag)) - if not req_path.startswith("/"): + parts = urllib.parse.urlsplit(url) + path = escape_path(parts.path) + if not path.startswith("/"): # fix bad RFC 2396 absoluteURI - req_path = "/"+req_path - return req_path + path = "/" + path + return path def request_port(request): host = request.get_host() |