mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Issue #22278: Fix urljoin problem with relative urls, a regression observed
after changes to issue22118 were submitted. Patch contributed by Demian Brecht and reviewed by Antoine Pitrou.
This commit is contained in:
parent
e6c27c9f6b
commit
a66e3885fb
3 changed files with 20 additions and 1 deletions
|
@ -380,6 +380,18 @@ class UrlParseTestCase(unittest.TestCase):
|
|||
# self.checkJoin(SIMPLE_BASE, '../../../g','http://a/../g')
|
||||
# self.checkJoin(SIMPLE_BASE, '/./g','http://a/./g')
|
||||
|
||||
# test for issue22118 duplicate slashes
|
||||
self.checkJoin(SIMPLE_BASE + '/', 'foo', SIMPLE_BASE + '/foo')
|
||||
|
||||
# Non-RFC-defined tests, covering variations of base and trailing
|
||||
# slashes
|
||||
self.checkJoin('http://a/b/c/d/e/', '../../f/g/', 'http://a/b/c/f/g/')
|
||||
self.checkJoin('http://a/b/c/d/e', '../../f/g/', 'http://a/b/f/g/')
|
||||
self.checkJoin('http://a/b/c/d/e/', '/../../f/g/', 'http://a/f/g/')
|
||||
self.checkJoin('http://a/b/c/d/e', '/../../f/g/', 'http://a/f/g/')
|
||||
self.checkJoin('http://a/b/c/d/e/', '../../f/g', 'http://a/b/c/f/g')
|
||||
self.checkJoin('http://a/b/', '../../f/g/', 'http://a/f/g/')
|
||||
|
||||
def test_RFC2732(self):
|
||||
str_cases = [
|
||||
('http://Test.python.org:5432/foo/', 'test.python.org', 5432),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue