mirror of https://github.com/python/cpython
Merged revisions 87329 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87329 | senthil.kumaran | 2010-12-17 12:48:45 +0800 (Fri, 17 Dec 2010) | 3 lines Fix Issue9721 - urljoin behavior when the relative url starts with ';' ........
This commit is contained in:
parent
3e8cd62d03
commit
5c7fd6eefa
|
@ -295,6 +295,9 @@ class UrlParseTestCase(unittest.TestCase):
|
||||||
#self.checkJoin(RFC3986_BASE, 'http:g','http:g') # strict parser
|
#self.checkJoin(RFC3986_BASE, 'http:g','http:g') # strict parser
|
||||||
self.checkJoin(RFC3986_BASE, 'http:g','http://a/b/c/g') # relaxed parser
|
self.checkJoin(RFC3986_BASE, 'http:g','http://a/b/c/g') # relaxed parser
|
||||||
|
|
||||||
|
# Test for issue9721
|
||||||
|
self.checkJoin('http://a/b/c/de', ';x','http://a/b/c/;x')
|
||||||
|
|
||||||
def test_urljoins(self):
|
def test_urljoins(self):
|
||||||
self.checkJoin(SIMPLE_BASE, 'g:h','g:h')
|
self.checkJoin(SIMPLE_BASE, 'g:h','g:h')
|
||||||
self.checkJoin(SIMPLE_BASE, 'http:g','http://a/b/c/g')
|
self.checkJoin(SIMPLE_BASE, 'http:g','http://a/b/c/g')
|
||||||
|
|
|
@ -256,14 +256,9 @@ def urljoin(base, url, allow_fragments=True):
|
||||||
if path[:1] == '/':
|
if path[:1] == '/':
|
||||||
return urlunparse((scheme, netloc, path,
|
return urlunparse((scheme, netloc, path,
|
||||||
params, query, fragment))
|
params, query, fragment))
|
||||||
if not path:
|
if not path and not params:
|
||||||
path = bpath
|
path = bpath
|
||||||
if not params:
|
params = bparams
|
||||||
params = bparams
|
|
||||||
else:
|
|
||||||
path = path[:-1]
|
|
||||||
return urlunparse((scheme, netloc, path,
|
|
||||||
params, query, fragment))
|
|
||||||
if not query:
|
if not query:
|
||||||
query = bquery
|
query = bquery
|
||||||
return urlunparse((scheme, netloc, path,
|
return urlunparse((scheme, netloc, path,
|
||||||
|
|
|
@ -21,6 +21,8 @@ Core and Builtins
|
||||||
|
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
- Issue #9721: Fix the behavior of urljoin when the relative url starts with a
|
||||||
|
';' character. Patch by Wes Chow.
|
||||||
|
|
||||||
- Issue #10714: Limit length of incoming request in http.server to 65536 bytes
|
- Issue #10714: Limit length of incoming request in http.server to 65536 bytes
|
||||||
for security reasons. Initial patch by Ross Lagerwall.
|
for security reasons. Initial patch by Ross Lagerwall.
|
||||||
|
|
Loading…
Reference in New Issue