Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion httpobs/scanner/analyzer/headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,11 @@ def cookies(reqs: dict, expectation='cookies-secure-with-httponly-sessions') ->
if key.lower() == 'httponly' and getattr(cookie, 'httponly') is False:
cookie.httponly = True
elif key.lower() == 'samesite' and getattr(cookie, 'samesite') is False:
if cookie._rest[key] is True or cookie._rest[key].strip().lower() == 'strict':
if cookie._rest[key] is None:
output['result'] = only_if_worse('cookies-samesite-flag-invalid',
output['result'],
goodness)
elif cookie._rest[key] is True or cookie._rest[key].strip().lower() == 'strict':
cookie.samesite = 'Strict'
output['sameSite'] = True
elif cookie._rest[key].strip().lower() == 'lax':
Expand Down