Compare commits

...

2 Commits

Author SHA1 Message Date
Ryan Welton
ae81995d68
Merge 6e34e8f579 into 0153b387e5 2024-06-13 11:03:11 +00:00
Ryan Welton
6e34e8f579 [utils] base_url: URL paths can contain & (yt-dlp#4841) 2023-01-23 13:43:49 -05:00
2 changed files with 2 additions and 1 deletions

View File

@ -550,6 +550,7 @@ class TestUtil(unittest.TestCase):
self.assertEqual(base_url('http://foo.de/bar/'), 'http://foo.de/bar/')
self.assertEqual(base_url('http://foo.de/bar/baz'), 'http://foo.de/bar/')
self.assertEqual(base_url('http://foo.de/bar/baz?x=z/x/c'), 'http://foo.de/bar/')
self.assertEqual(base_url('http://foo.de/bar/baz&x=z&w=y/x/c'), 'http://foo.de/bar/baz&x=z&w=y/x/')
def test_urljoin(self):
self.assertEqual(urljoin('http://foo.de/', '/a/b/c.txt'), 'http://foo.de/a/b/c.txt')

View File

@ -3819,7 +3819,7 @@ def url_basename(url):
def base_url(url):
return re.match(r'https?://[^?#&]+/', url).group()
return re.match(r'https?://[^?#]+/', url).group()
def urljoin(base, path):