Opened 9 years ago

Closed 9 years ago

#25368 closed Cleanup/optimization (invalid)

Rename X_CSRFTOKEN to X-CSRFTOKEN

Reported by: Belegnar Owned by: nobody
Component: CSRF Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Is it possible to rename X_CSRFTOKEN to X-CSRFTOKEN at middleware/csrf.py ?
Using underscore in http header name is not common at all.
http://www.iana.org/assignments/message-headers/message-headers.xml#perm-headers

Change History (1)

comment:1 by Tim Graham, 9 years ago

Resolution: invalid
Status: newclosed

Hi, I think you've missed the documentation on how Django treats HTTP headers:

any HTTP headers in the request are converted to META keys by converting all characters to uppercase, replacing any hyphens with underscores and adding an HTTP_ prefix to the name. So, for example, a header called X-Bender would be mapped to the META key HTTP_X_BENDER.

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