2019-04-17 05:36:30 +00:00
|
|
|
from tests.helpers import create_ctfd, destroy_ctfd
|
2019-01-08 07:52:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_sessions_set_httponly():
|
|
|
|
app = create_ctfd()
|
|
|
|
with app.app_context():
|
|
|
|
with app.test_client() as client:
|
2019-05-12 01:09:37 +00:00
|
|
|
r = client.get("/")
|
|
|
|
cookie = dict(r.headers)["Set-Cookie"]
|
|
|
|
assert "HttpOnly;" in cookie
|
2019-01-08 07:52:51 +00:00
|
|
|
destroy_ctfd(app)
|
|
|
|
|
|
|
|
|
|
|
|
def test_sessions_set_samesite():
|
|
|
|
app = create_ctfd()
|
|
|
|
with app.app_context():
|
|
|
|
with app.test_client() as client:
|
2019-05-12 01:09:37 +00:00
|
|
|
r = client.get("/")
|
|
|
|
cookie = dict(r.headers)["Set-Cookie"]
|
|
|
|
assert "SameSite=" in cookie
|
2019-01-08 07:52:51 +00:00
|
|
|
destroy_ctfd(app)
|