#9712 closed (fixed)
Format of HTTP headers in request.META not clear
Reported by: | Masklinn | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The documentation for HttpRequest.META clearly indicates that HTTP headers are stored in it, but it doesn't clearly spell the format: Content-Length
becomes CONTENT_LENGTH
, but Accept-Encoding
becomes HTTP_ACCEPT_ENCODING
.
It might be useful to specify that (apart from special cases), all HTTP headers get prefixed by HTTP_
and all "-"
characters are replaced by "_"
characters (e.g. X-Forwarded-For
becomes HTTP_X_FORWARDED_FROM
).
A basic patch is provided, applies cleanly against branch 1.0.X @rev 9534
Attachments (1)
Change History (3)
by , 16 years ago
Attachment: | meta_headers.patch added |
---|
comment:1 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(In [9582]) [1.0.X] Fixed #9712 -- Documented how HTTP headers are converted to request.META keys. Based on a patch from masklinn.
Backport of r9579 from trunk.