mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +00:00
Fix for COOKIE_MODE in settings.py (#8268)
- Backport of https://github.com/inventree/InvenTree/pull/8262
This commit is contained in:
parent
6c0f6e38d0
commit
933a5a5595
@ -1065,13 +1065,13 @@ COOKIE_MODE = (
|
||||
.strip()
|
||||
)
|
||||
|
||||
valid_cookie_modes = {'lax': 'Lax', 'strict': 'Strict', 'none': None, 'null': None}
|
||||
valid_cookie_modes = {'lax': 'Lax', 'strict': 'Strict', 'none': 'None', 'null': 'None'}
|
||||
|
||||
if COOKIE_MODE not in valid_cookie_modes.keys():
|
||||
logger.error('Invalid cookie samesite mode: %s', COOKIE_MODE)
|
||||
sys.exit(-1)
|
||||
|
||||
COOKIE_MODE = valid_cookie_modes[COOKIE_MODE.lower()]
|
||||
COOKIE_MODE = valid_cookie_modes.get(COOKIE_MODE.lower(), 'None')
|
||||
|
||||
# Additional CSRF settings
|
||||
CSRF_HEADER_NAME = 'HTTP_X_CSRFTOKEN'
|
||||
|
Loading…
x
Reference in New Issue
Block a user