Opened 8 years ago

Closed 8 years ago

Last modified 8 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:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:


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 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by masklinn

comment:1 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(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 Changed 8 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

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