mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add util.add_samesite_fields(response, value)
This function adds f"SameSite={value}" to each cookie's header stored in response. This is needed because starlette does not currently support the `samesite` argument in Response.set_cookie. It is merged, however, and waiting for next release. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
ec632a7091
commit
91dc3efc75
6 changed files with 23 additions and 5 deletions
|
@ -111,6 +111,8 @@ def test_secure_login(mock):
|
|||
cookie = next(c for c in response.cookies if c.name == "AURSID")
|
||||
assert cookie.secure is True
|
||||
assert cookie.has_nonstandard_attr("HttpOnly") is True
|
||||
assert cookie.has_nonstandard_attr("SameSite") is True
|
||||
assert cookie.get_nonstandard_attr("SameSite") == "strict"
|
||||
assert cookie.value is not None and len(cookie.value) > 0
|
||||
|
||||
# Let's make sure we actually have a session relationship
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue