1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

inlined 2 variables (clarified intent)

This commit is contained in:
Klaas van Schelven 2024-09-25 13:54:37 +02:00
parent 39de2e97a0
commit a0d327a62f

View File

@ -287,11 +287,11 @@ class CsrfViewMiddleware(MiddlewareMixin):
parsed_origin = urlsplit(request_origin) parsed_origin = urlsplit(request_origin)
except ValueError: except ValueError:
return False return False
request_scheme = parsed_origin.scheme parsed_origin_scheme = parsed_origin.scheme
request_netloc = parsed_origin.netloc parsed_origin_netloc = parsed_origin.netloc
return any( return any(
is_same_domain(request_netloc, host) is_same_domain(parsed_origin_netloc, host)
for host in self.allowed_origin_subdomains.get(request_scheme, ()) for host in self.allowed_origin_subdomains.get(parsed_origin_scheme, ())
) )
def _check_referer(self, request): def _check_referer(self, request):