Skip to content

Commit b11e63d

Browse files
committed
chore(controller): set default CSRF_COOKIE_SECURE false
1 parent 79f5b46 commit b11e63d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

rootfs/api/settings/production.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
'security.W004',
2727
'security.W008',
2828
'security.W012',
29+
'security.W016',
2930
]
3031

3132
CONN_MAX_AGE = 60 * 3
@@ -139,12 +140,13 @@
139140
)
140141

141142
X_FRAME_OPTIONS = 'DENY'
142-
CSRF_COOKIE_SECURE = True
143143
CSRF_COOKIE_HTTPONLY = False
144144
CSRF_COOKIE_SAMESITE = None
145-
SESSION_COOKIE_SECURE = False
146145
SECURE_CONTENT_TYPE_NOSNIFF = True
147146
SECURE_BROWSER_XSS_FILTER = True
147+
SESSION_COOKIE_SECURE = bool(strtobool(os.environ.get('SESSION_COOKIE_SECURE', 'false')))
148+
CSRF_COOKIE_SECURE = bool(strtobool(os.environ.get('CSRF_COOKIE_SECURE', 'false')))
149+
148150

149151
# Honor HTTPS from a trusted proxy
150152
# see https://docs.djangoproject.com/en/1.11/ref/settings/#secure-proxy-ssl-header

0 commit comments

Comments
 (0)