about summary refs log tree commit diff
path: root/test
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-06-01 18:05:41 +0530
committerdirkf <fieldhouse@gmx.net>2023-02-20 20:27:25 +0000
commit1d3751c3fe50b203d3e2bff71d866c8c500f8288 (patch)
treef114ce1ae17ea24c44f3e3b5e5428822d4040c0d /test
parent6067451e432fb65d487a8a67bb5cff52efb9ccf4 (diff)
downloadyoutube-dl-1d3751c3fe50b203d3e2bff71d866c8c500f8288.tar.gz
youtube-dl-1d3751c3fe50b203d3e2bff71d866c8c500f8288.tar.xz
youtube-dl-1d3751c3fe50b203d3e2bff71d866c8c500f8288.zip
Escape URLs in `sanitized_Request`, not `sanitize_url` d2558234cf5dd12d6896eed5427b7dcdb3ab7b5a added escaping of URLs while sanitizing. However, `sanitize_url` may not always receive an actual URL. Eg: When using `youtube-dl "search query" --default-search ytsearch`, `search query` gets escaped to `search%20query` before being prefixed with `ytsearch:` which is not the intended behavior. So the escaping is moved to `sanitized_Request` instead.
Diffstat (limited to 'test')
-rw-r--r--test/test_utils.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index 9d364c863..ea2b96ed2 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -250,6 +250,7 @@ class TestUtil(unittest.TestCase):
         self.assertEqual(sanitize_url('httpss://foo.bar'), 'https://foo.bar')
         self.assertEqual(sanitize_url('rmtps://foo.bar'), 'rtmps://foo.bar')
         self.assertEqual(sanitize_url('https://foo.bar'), 'https://foo.bar')
+        self.assertEqual(sanitize_url('foo bar'), 'foo bar')
 
     def test_expand_path(self):
         def env(var):