mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #16010 -- Required CSRF_TRUSTED_ORIGINS setting to include the scheme.
This commit is contained in:
committed by
Mariusz Felisiak
parent
9bf5e9418f
commit
dba44a7a7a
@@ -399,7 +399,7 @@ class CsrfViewMiddlewareTestMixin:
|
||||
resp = mw.process_view(req, post_form_view, (), {})
|
||||
self.assertIsNone(resp)
|
||||
|
||||
@override_settings(ALLOWED_HOSTS=['www.example.com'], CSRF_TRUSTED_ORIGINS=['dashboard.example.com'])
|
||||
@override_settings(ALLOWED_HOSTS=['www.example.com'], CSRF_TRUSTED_ORIGINS=['https://dashboard.example.com'])
|
||||
def test_https_csrf_trusted_origin_allowed(self):
|
||||
"""
|
||||
A POST HTTPS request with a referer added to the CSRF_TRUSTED_ORIGINS
|
||||
@@ -414,7 +414,7 @@ class CsrfViewMiddlewareTestMixin:
|
||||
resp = mw.process_view(req, post_form_view, (), {})
|
||||
self.assertIsNone(resp)
|
||||
|
||||
@override_settings(ALLOWED_HOSTS=['www.example.com'], CSRF_TRUSTED_ORIGINS=['.example.com'])
|
||||
@override_settings(ALLOWED_HOSTS=['www.example.com'], CSRF_TRUSTED_ORIGINS=['https://*.example.com'])
|
||||
def test_https_csrf_wildcard_trusted_origin_allowed(self):
|
||||
"""
|
||||
A POST HTTPS request with a referer that matches a CSRF_TRUSTED_ORIGINS
|
||||
|
||||
Reference in New Issue
Block a user