summaryrefslogtreecommitdiffstats
path: root/Lib/http/cookiejar.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2010-07-19 23:17:22 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2010-07-19 23:17:22 (GMT)
commit41e6c3df8bd8e7f3990886c5269b2f446095de38 (patch)
treedc10cb4e2aa2eba5252e4848e72469a6c49c29a7 /Lib/http/cookiejar.py
parent79e17f6f666e6b41320b7355c34d8a292fa5b586 (diff)
downloadcpython-41e6c3df8bd8e7f3990886c5269b2f446095de38.zip
cpython-41e6c3df8bd8e7f3990886c5269b2f446095de38.tar.gz
cpython-41e6c3df8bd8e7f3990886c5269b2f446095de38.tar.bz2
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/cookiejar.py')
-rw-r--r--Lib/http/cookiejar.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py
index 657faa1..57332c6 100644
--- a/Lib/http/cookiejar.py
+++ b/Lib/http/cookiejar.py
@@ -609,17 +609,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()