django4: replaced deprecated request.is_ajax() call (#68571)

This commit is contained in:
Agate 2022-08-31 09:12:39 +02:00
parent 366758a54d
commit 1740cd7483
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ class PassiveAuthenticationMiddleware(MiddlewareMixin):
if 'no-passive-auth' in request.GET:
return
# Skip AJAX requests
if request.is_ajax():
if request.headers.get('x-requested-with') == 'XMLHttpRequest':
return
# Skip AJAX and media/script requests, unless mellon_no_passive is False on the view
if getattr(view_func, 'mellon_no_passive', True) and 'text/html' not in request.META.get(