Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#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)

meta_headers.patch (735 bytes ) - added by Masklinn 15 years ago.

Download all attachments as: .zip

Change History (3)

by Masklinn, 15 years ago

Attachment: meta_headers.patch added

comment:1 by Malcolm Tredinnick, 15 years ago

Resolution: fixed
Status: newclosed

(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.

comment:2 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top