mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
Default SameSite session cookie setting to Lax (#824)
This commit is contained in:
21
tests/utils/test_sessions.py
Normal file
21
tests/utils/test_sessions.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from tests.helpers import *
|
||||
|
||||
|
||||
def test_sessions_set_httponly():
|
||||
app = create_ctfd()
|
||||
with app.app_context():
|
||||
with app.test_client() as client:
|
||||
r = client.get('/')
|
||||
cookie = dict(r.headers)['Set-Cookie']
|
||||
assert 'HttpOnly;' in cookie
|
||||
destroy_ctfd(app)
|
||||
|
||||
|
||||
def test_sessions_set_samesite():
|
||||
app = create_ctfd()
|
||||
with app.app_context():
|
||||
with app.test_client() as client:
|
||||
r = client.get('/')
|
||||
cookie = dict(r.headers)['Set-Cookie']
|
||||
assert 'SameSite=' in cookie
|
||||
destroy_ctfd(app)
|
||||
Reference in New Issue
Block a user