Opened 17 years ago
Closed 17 years ago
#6775 closed (invalid)
request.META should be a MultiValueDict
Reported by: | Honza Král | Owned by: | nobody |
---|---|---|---|
Component: | HTTP handling | Version: | dev |
Severity: | Keywords: | http multivaluedict querydict | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The RFC specifies that some headers in HTTP can appear more than once, we need to store the headers in MultiValueDict
to reflect that.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
Multiple message-header fields with the same field-name MAY be present in a message
Note:
See TracTickets
for help on using tickets.
This change would be backward incompatible. Let's see what RFC 2616 says:
Let's check how will *mod_python* and *WSGI* act using
curl
:mod_python
In case of mod_python handler request.META is populated with custom headers by following chunk of code:
Notice that
self._req.headers_in
provider by mod_python is an ordinarydict
.mod_python seems to handle multiple headers occurrences in the RFC2616-way - by combining multiple header fields' values into the comma separated list.
I wonder if separating items using '<comma><space>' delimiter is the right thing but that's not Django's business.
WSGI
WSGI response was very similar:
Summary
It seems that it's correct behaviour and no changes in Django are required so I'm closing this ticket as invalid.