mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[utils] strip #HttpOnly_ prefix from cookies files (#20219)
This commit is contained in:
		| @@ -29,6 +29,16 @@ class TestYoutubeDLCookieJar(unittest.TestCase): | ||||
|             tf.close() | ||||
|             os.remove(tf.name) | ||||
|  | ||||
|     def test_strip_httponly_prefix(self): | ||||
|         cookiejar = YoutubeDLCookieJar('./test/testdata/cookies/httponly_cookies.txt') | ||||
|         cookiejar.load(ignore_discard=True, ignore_expires=True) | ||||
|  | ||||
|         def assert_cookie_has_value(key): | ||||
|             self.assertEqual(cookiejar._cookies['www.foobar.foobar']['/'][key].value, key + '_VALUE') | ||||
|  | ||||
|         assert_cookie_has_value('HTTPONLY_COOKIE') | ||||
|         assert_cookie_has_value('JS_ACCESSIBLE_COOKIE') | ||||
|  | ||||
|  | ||||
| if __name__ == '__main__': | ||||
|     unittest.main() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 remitamine
					remitamine