mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 19:43:47 +00:00
middleware: Set the correct options on the django_language cookie.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
53df35e698
commit
70dbeb197f
@@ -3,7 +3,7 @@ import os
|
||||
import sys
|
||||
import time
|
||||
from copy import deepcopy
|
||||
from typing import Any, Dict, List, Tuple, Union
|
||||
from typing import Any, Dict, Final, List, Tuple, Union
|
||||
from urllib.parse import urljoin
|
||||
|
||||
from scripts.lib.zulip_tools import get_tornado_ports
|
||||
@@ -398,6 +398,7 @@ else:
|
||||
if PRODUCTION:
|
||||
SESSION_COOKIE_SECURE = True
|
||||
CSRF_COOKIE_SECURE = True
|
||||
LANGUAGE_COOKIE_SECURE = True
|
||||
|
||||
# https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-05#section-4.1.3.2
|
||||
SESSION_COOKIE_NAME = "__Host-sessionid"
|
||||
@@ -409,6 +410,9 @@ if PRODUCTION:
|
||||
CSRF_COOKIE_HTTPONLY = True
|
||||
CSRF_FAILURE_VIEW = "zerver.middleware.csrf_failure"
|
||||
|
||||
# Avoid a deprecation message in the Firefox console
|
||||
LANGUAGE_COOKIE_SAMESITE: Final = "Lax"
|
||||
|
||||
if DEVELOPMENT:
|
||||
# Use fast password hashing for creating testing users when not
|
||||
# PRODUCTION. Saves a bunch of time.
|
||||
|
||||
Reference in New Issue
Block a user