From a007013a49378d60a57558867719b5e8565e5f3e Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 4 Nov 2022 15:01:24 -0700 Subject: [PATCH] Add LANGUAGE_COOKIE_* settings (#1228) Co-authored-by: Adam Johnson --- django-stubs/conf/global_settings.pyi | 2 ++ django-stubs/http/response.pyi | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/django-stubs/conf/global_settings.pyi b/django-stubs/conf/global_settings.pyi index d66ccf935..d18699366 100644 --- a/django-stubs/conf/global_settings.pyi +++ b/django-stubs/conf/global_settings.pyi @@ -61,6 +61,8 @@ LANGUAGE_COOKIE_NAME: str = ... LANGUAGE_COOKIE_AGE: Optional[int] = ... LANGUAGE_COOKIE_DOMAIN: Optional[str] = ... LANGUAGE_COOKIE_PATH: str = ... +LANGUAGE_COOKIE_HTTPONLY: bool = ... +LANGUAGE_COOKIE_SAMESITE: Literal["Lax", "Strict", "None", False] = ... # If you set this to True, Django will format dates, numbers and calendars # according to user current locale. diff --git a/django-stubs/http/response.pyi b/django-stubs/http/response.pyi index cd2450852..449c989eb 100644 --- a/django-stubs/http/response.pyi +++ b/django-stubs/http/response.pyi @@ -63,7 +63,7 @@ class HttpResponseBase: domain: Optional[str] = ..., secure: bool = ..., httponly: bool = ..., - samesite: Optional[Literal["Lax", "Strict", "None"]] = ..., + samesite: Optional[Literal["Lax", "Strict", "None", False]] = ..., ) -> None: ... def setdefault(self, key: str, value: str) -> None: ... def set_signed_cookie(self, key: str, value: str, salt: str = ..., **kwargs: Any) -> None: ... @@ -72,7 +72,7 @@ class HttpResponseBase: key: str, path: str = ..., domain: Optional[str] = ..., - samesite: Optional[Literal["Lax", "Strict", "None"]] = ..., + samesite: Optional[Literal["Lax", "Strict", "None", False]] = ..., ) -> None: ... def make_bytes(self, value: object) -> bytes: ... def close(self) -> None: ...