#37025: Deprecate the prefixing of HTTP_ to header names in
RemoteUserMiddleware.aprocess_request()
------------------------------+---------------------------------------
     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:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+---------------------------------------
Comment (by Carlton Gibson):

 Grrr. I'm not sure of the value of this change. It looks like a breaking
 change without benefit to my eye. Indeed, if I'm using this with ASGI I
 would be forced to subclass in order to provide the full header value,
 `HTTP_REMOTE_USER`, to use the middleware at all.

 The WSGI implementation is based on the idea that in the normal case the
 `request.META` entry is **not** in fact an HTTP header, but an environment
 variable. In contrast in the ASGI case, the value must come from a header
 value, as there's no other way. Thus the difference in implementation.

 I'm pretty sceptical that people are needing both WSGI and ASGI versions
 of the middleware with the same custom header value. Possibly would could
 add an `resolve_meta_key` helper, called on the `aprocess_request` path
 that formatted the header, maybe via a class attribute, which could then
 be overridden to unify the approach if a fully qualified header was
 provided. 🤷
-- 
Ticket URL: <https://code.djangoproject.com/ticket/37025#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019d71fdfd56-4b8bf35f-983d-478d-91f0-6c744f64cc81-000000%40eu-central-1.amazonses.com.

Reply via email to