Turn on secure cookie support if the server os environment expects to use secure connections

This commit is contained in:
Garret Wassermann 2021-09-27 22:12:32 -04:00
parent e8efa4d263
commit 166d552fba

View File

@ -5,6 +5,7 @@ Default settings for django-helpdesk.
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
import os
DEFAULT_USER_SETTINGS = {
'login_view_ticketlist': True,
@ -22,6 +23,13 @@ except AttributeError:
HAS_TAG_SUPPORT = False
# check for secure cookie support
if os.environ.get('SECURE_PROXY_SSL_HEADER'):
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
##########################################
# generic options - visible on all pages #
##########################################