[Django] #37079: RemoteUserMiddleware assumes all ASGI requests will be handled by its sync path

8 views
Skip to first unread message

Django

unread,
May 1, 2026, 12:56:58 PMMay 1
to django-...@googlegroups.com
#37079: RemoteUserMiddleware assumes all ASGI requests will be handled by its sync
path
----------------------------------------+-----------------------------
Reporter: Jacob Walls | Owner: Jacob Walls
Type: Bug | Status: assigned
Component: contrib.auth | Version: 5.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+-----------------------------
As pointed out in a
[https://github.com/django/django/pull/21079#discussion_r3070329801
review], `RemoteUserMiddleware` doesn't account for the case where an ASGI
request passes through (sync) `process_request()` due to subsequent sync-
only middleware in the stack. This could cause the wrong header to be
looked up.

Bug in 50f89ae850f6b4e35819fe725a08c7e579bfd099.
--
Ticket URL: <https://code.djangoproject.com/ticket/37079>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 1, 2026, 1:03:34 PMMay 1
to django-...@googlegroups.com
#37079: RemoteUserMiddleware assumes all ASGI requests will be handled by its sync
path
------------------------------+---------------------------------------
Reporter: Jacob Walls | Owner: Jacob Walls
Type: Bug | Status: assigned
Component: contrib.auth | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+---------------------------------------
Comment (by Jacob Walls):

[https://github.com/django/django/pull/21208 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/37079#comment:1>
Reply all
Reply to author
Forward
0 new messages