#20147: Provide an alternative to request.META for accessing HTTP headers
-------------------------------+------------------------------------
Reporter: lukeplant | Owner: nobody
Type: New feature | Status: new
Component: HTTP handling | Version: 1.5
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Comment (by collinanderson):
Proof of concept: https://github.com/django/django/pull/6803
This makes `request.headers` have lowercase header names, and replaces
underscores with hyphens. (header names are lowercase in http2)
Also, on python3 we already get unicode headers from WSGI, and we're
dropping py2 in January, so I don't think it's worth making the values
unicode on python2. The header names are already unicode on python2.
{{{
{
'accept-language': 'en-US,en;q=0.8',
'accept-encoding': 'gzip, deflate, sdch',
'host': 'localhost:8000',
'accept':
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'upgrade-insecure-requests': '1',
'connection': 'keep-alive',
'cache-control': 'max-age=0',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36',
}
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/20147#comment:16>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.c36f3b8fcba96c02148333f39add6e69%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.