Skip to content

Commit b8b69b1

Browse files
committed
Added a patch for Django to permit cookie 'samesite' setting to be explicitly set to 'None'.
- Legacy-Id: 18138
1 parent 3800c4b commit b8b69b1

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- django/http//response.py.orig 2020-07-08 14:34:42.776562458 +0200
2+
+++ django/http//response.py 2020-07-08 14:35:56.454687322 +0200
3+
@@ -197,8 +197,8 @@
4+
if httponly:
5+
self.cookies[key]['httponly'] = True
6+
if samesite:
7+
- if samesite.lower() not in ('lax', 'strict'):
8+
- raise ValueError('samesite must be "lax" or "strict".')
9+
+ if samesite.lower() not in ('lax', 'strict', 'none'):
10+
+ raise ValueError('samesite must be "lax", "strict", or "none".')
11+
self.cookies[key]['samesite'] = samesite
12+
13+
def setdefault(self, key, value):

0 commit comments

Comments
 (0)