diff options
author | Loïc Hoguin <[email protected]> | 2022-05-06 14:23:33 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2022-09-12 11:06:38 +0200 |
commit | 180ce23aba863d94c17ee0667cad1ed916f56da1 (patch) | |
tree | bb1f5224374700ad5de8e8772d396a91f74bd45b /src/gun_cookies.erl | |
parent | 0724dbf536c22fc978ba0bc96052c65f0edafa69 (diff) | |
download | gun-180ce23aba863d94c17ee0667cad1ed916f56da1.tar.gz gun-180ce23aba863d94c17ee0667cad1ed916f56da1.tar.bz2 gun-180ce23aba863d94c17ee0667cad1ed916f56da1.zip |
Update cookie tests against latest WPT
The http-state tests were removed and replaced with
tests in HTML pages. I have devised a way to semi-
automatically import them and test them.
Additional fixes were made following changes in
the rfc6265bis draft.
Diffstat (limited to 'src/gun_cookies.erl')
-rw-r--r-- | src/gun_cookies.erl | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gun_cookies.erl b/src/gun_cookies.erl index f44ae42..984e491 100644 --- a/src/gun_cookies.erl +++ b/src/gun_cookies.erl @@ -185,6 +185,8 @@ session_gc({Mod, State0}) -> %% @todo The given URI must be normalized. -spec set_cookie(Store, uri_string:uri_map(), binary(), binary(), cow_cookie:cookie_attrs()) -> {ok, Store} | {error, any()} when Store::store(). +set_cookie(_, _, Name, Value, _) when byte_size(Name) + byte_size(Value) > 4096 -> + {error, larger_than_4096_bytes}; set_cookie(Store, URI=#{host := Host}, Name, Value, Attrs) -> %% This is where we would add a feature to block cookies (like a blacklist). CurrentTime = erlang:universaltime(), |