diff options
author | Simon Sawicki <37424085+Grub4K@users.noreply.github.com> | 2022-10-11 05:39:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-11 09:09:12 +0530 |
commit | 36069409ec7ed88f7571f29ff35a5a4c62b70cfc (patch) | |
tree | dfc20f2acf081170fdc99e703d63ea8f5bc29c59 /test/test_cookies.py | |
parent | 0468a3b3253957bfbeb98b4a7c71542ff80e9e06 (diff) | |
download | hypervideo-pre-36069409ec7ed88f7571f29ff35a5a4c62b70cfc.tar.lz hypervideo-pre-36069409ec7ed88f7571f29ff35a5a4c62b70cfc.tar.xz hypervideo-pre-36069409ec7ed88f7571f29ff35a5a4c62b70cfc.zip |
[cookies] Improve `LenientSimpleCookie` (#5195)
Closes #5186
Authored by: Grub4K
Diffstat (limited to 'test/test_cookies.py')
-rw-r--r-- | test/test_cookies.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_cookies.py b/test/test_cookies.py index 61619df29..4155bcbf5 100644 --- a/test/test_cookies.py +++ b/test/test_cookies.py @@ -278,8 +278,23 @@ class TestLenientSimpleCookie(unittest.TestCase): {"a": "b", "c": "d"}, ), ( + "Reset morsel after invalid to not capture attributes", + "a=b; $invalid; $Version=1; c=d", + {"a": "b", "c": "d"}, + ), + ( "Continue after non-flag attribute without value", "a=b; path; Version=1; c=d", {"a": "b", "c": "d"}, ), + ( + "Allow cookie attributes with `$` prefix", + 'Customer="WILE_E_COYOTE"; $Version=1; $Secure; $Path=/acme', + {"Customer": ("WILE_E_COYOTE", {"version": "1", "secure": True, "path": "/acme"})}, + ), + ( + "Invalid Morsel keys should not result in an error", + "Key=Value; [Invalid]=Value; Another=Value", + {"Key": "Value", "Another": "Value"}, + ), ) |