Skip to content

Commit 57026bb

Browse files
Revert "chore: Remove django-cookie-delete-with-all-settings.patch"
This reverts commit 2cf2a3d.
1 parent 69eb634 commit 57026bb

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

ietf/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
DATABASES = {
7777
'default': {
7878
'NAME': 'datatracker',
79-
'ENGINE': 'django.db.backends.postgresql',
79+
'ENGINE': 'django.db.backends.postgresql_psycopg2',
8080
'USER': 'ietf',
8181
#'PASSWORD': 'somepassword',
8282
},
@@ -430,6 +430,7 @@ def skip_unreadable_post(record):
430430
'corsheaders',
431431
'django_markup',
432432
'django_password_strength',
433+
'form_utils',
433434
'oidc_provider',
434435
'simple_history',
435436
'tastypie',
@@ -1122,6 +1123,7 @@ def skip_unreadable_post(record):
11221123
'patch/fix-jwkest-jwt-logging.patch',
11231124
'patch/fix-django-password-strength-kwargs.patch',
11241125
'patch/add-django-http-cookie-value-none.patch',
1126+
'patch/django-cookie-delete-with-all-settings.patch',
11251127
'patch/tastypie-django22-fielderror-response.patch',
11261128
]
11271129
if DEBUG:
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
--- django/contrib/messages/storage/cookie.py.orig 2020-08-13 11:10:36.719177122 +0200
2+
+++ django/contrib/messages/storage/cookie.py 2020-08-13 11:45:23.503463150 +0200
3+
@@ -92,6 +92,8 @@
4+
response.delete_cookie(
5+
self.cookie_name,
6+
domain=settings.SESSION_COOKIE_DOMAIN,
7+
+ secure=settings.SESSION_COOKIE_SECURE or None,
8+
+ httponly=settings.SESSION_COOKIE_HTTPONLY or None,
9+
samesite=settings.SESSION_COOKIE_SAMESITE,
10+
)
11+
12+
--- django/http/response.py.orig 2020-08-13 11:16:04.060627793 +0200
13+
+++ django/http/response.py 2020-08-13 11:54:03.482476973 +0200
14+
@@ -210,12 +210,18 @@
15+
value = signing.get_cookie_signer(salt=key + salt).sign(value)
16+
return self.set_cookie(key, value, **kwargs)
17+
18+
- def delete_cookie(self, key, path='/', domain=None, samesite=None):
19+
+ def delete_cookie(self, key, path='/', domain=None, secure=False, httponly=False, samesite=None):
20+
# Most browsers ignore the Set-Cookie header if the cookie name starts
21+
# with __Host- or __Secure- and the cookie doesn't use the secure flag.
22+
- secure = key.startswith(('__Secure-', '__Host-'))
23+
+ if key in self.cookies:
24+
+ domain = self.cookies[key].get('domain', domain)
25+
+ secure = self.cookies[key].get('secure', secure)
26+
+ httponly = self.cookies[key].get('httponly', httponly)
27+
+ samesite = self.cookies[key].get('samesite', samesite)
28+
+ else:
29+
+ secure = secure or key.startswith(('__Secure-', '__Host-'))
30+
self.set_cookie(
31+
- key, max_age=0, path=path, domain=domain, secure=secure,
32+
+ key, max_age=0, path=path, domain=domain, secure=secure, httponly=httponly,
33+
expires='Thu, 01 Jan 1970 00:00:00 GMT', samesite=samesite,
34+
)
35+
36+
--- django/contrib/sessions/middleware.py.orig 2020-08-13 12:12:12.401898114 +0200
37+
+++ django/contrib/sessions/middleware.py 2020-08-13 12:14:52.690520659 +0200
38+
@@ -39,6 +39,8 @@
39+
settings.SESSION_COOKIE_NAME,
40+
path=settings.SESSION_COOKIE_PATH,
41+
domain=settings.SESSION_COOKIE_DOMAIN,
42+
+ secure=settings.SESSION_COOKIE_SECURE or None,
43+
+ httponly=settings.SESSION_COOKIE_HTTPONLY or None,
44+
samesite=settings.SESSION_COOKIE_SAMESITE,
45+
)
46+
else:

0 commit comments

Comments
 (0)