summaryrefslogtreecommitdiffstats
path: root/Lib/cookielib.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2010-07-25 20:00:02 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2010-07-25 20:00:02 (GMT)
commit034ec7855685f4761abfcc8dd9f2e11579976e07 (patch)
tree342e0a46b32a1d9d7e54a326317e8ee1839182bd /Lib/cookielib.py
parent7c973454a9ba776d153196c2a4f05d8234ced542 (diff)
downloadcpython-034ec7855685f4761abfcc8dd9f2e11579976e07.zip
cpython-034ec7855685f4761abfcc8dd9f2e11579976e07.tar.gz
cpython-034ec7855685f4761abfcc8dd9f2e11579976e07.tar.bz2
Merged revisions 83145 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint ........ r83145 | gregory.p.smith | 2010-07-25 12:11:36 -0700 (Sun, 25 Jul 2010) | 3 lines Fixes issue #3704: cookielib was not properly handling URLs with a / in the parameters. ........
Diffstat (limited to 'Lib/cookielib.py')
-rw-r--r--Lib/cookielib.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/Lib/cookielib.py b/Lib/cookielib.py
index b61a2b2..5b25090 100644
--- a/Lib/cookielib.py
+++ b/Lib/cookielib.py
@@ -607,19 +607,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()
- #scheme, netloc, path, parameters, query, frag = urlparse.urlparse(url)
- #req_path = escape_path("".join(urlparse.urlparse(url)[2:]))
- path, parameters, query, frag = urlparse.urlparse(url)[2:]
- if parameters:
- path = "%s;%s" % (path, parameters)
- path = escape_path(path)
- req_path = urlparse.urlunparse(("", "", path, "", query, frag))
- if not req_path.startswith("/"):
+ parts = urlparse.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()