diff --git a/mellon/middleware.py b/mellon/middleware.py index 78ec782..9bc5ac8 100644 --- a/mellon/middleware.py +++ b/mellon/middleware.py @@ -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(