mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	[core] Fix HTTP headers and cookie handling
- Remove `Cookie` header from `http_headers` immediately after loading into cookiejar - Restore compat for `--load-info-json` cookies - Add more tests - Fix improper passing of Cookie header by `MailRu` extractor Closes #7558 Authored by: bashonly, pukkandan
This commit is contained in:
		| @@ -53,6 +53,14 @@ class TestYoutubeDLCookieJar(unittest.TestCase): | ||||
|         header = cookiejar.get_cookie_header('https://www.foobar.foobar') | ||||
|         self.assertIn('HTTPONLY_COOKIE', header) | ||||
| 
 | ||||
|     def test_get_cookies_for_url(self): | ||||
|         cookiejar = YoutubeDLCookieJar('./test/testdata/cookies/session_cookies.txt') | ||||
|         cookiejar.load(ignore_discard=True, ignore_expires=True) | ||||
|         cookies = cookiejar.get_cookies_for_url('https://www.foobar.foobar/') | ||||
|         self.assertEqual(len(cookies), 2) | ||||
|         cookies = cookiejar.get_cookies_for_url('https://foobar.foobar/') | ||||
|         self.assertFalse(cookies) | ||||
| 
 | ||||
| 
 | ||||
| if __name__ == '__main__': | ||||
|     unittest.main() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 bashonly
					bashonly