From 36069409ec7ed88f7571f29ff35a5a4c62b70cfc Mon Sep 17 00:00:00 2001 From: Simon Sawicki <37424085+Grub4K@users.noreply.github.com> Date: Tue, 11 Oct 2022 05:39:12 +0200 Subject: [cookies] Improve `LenientSimpleCookie` (#5195) Closes #5186 Authored by: Grub4K --- test/test_cookies.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/test_cookies.py') 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 @@ -277,9 +277,24 @@ class TestLenientSimpleCookie(unittest.TestCase): "a=b; invalid; Version=1; c=d", {"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"}, + ), ) -- cgit v1.2.3