#35838: request.read() returns empty for Requests w/ Transfer-Encoding: Chunked
------------------------------------+--------------------------------------
Reporter: Klaas van Schelven | Owner: (none)
Type: Uncategorized | Status: new
Component: HTTP handling | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Comment (by bcail):
Here's the first part of that paragraph:
> However, because WSGI servers and applications do not communicate via
HTTP, what RFC 2616 calls “hop-by-hop” headers do not apply to WSGI
internal communications. WSGI applications must not generate any “hop-by-
hop” headers, attempt to use HTTP features that would require them to
generate such headers, or rely on the content of any incoming “hop-by-hop”
headers in the environ dictionary.
There's also this quote, which is actually in a different section of the
spec:
> Applications and middleware are forbidden from using HTTP/1.1 “hop-by-
hop” features or headers...
There's also
[https://github.com/benoitc/gunicorn/issues/1264#issuecomment-254183925
these]
[https://github.com/benoitc/gunicorn/pull/1265#issuecomment-219251058
three]
[https://github.com/benoitc/gunicorn/pull/1265#issuecomment-219312733
quotes] from the issues you listed.
It seems like the idea from the spec is that the WSGI servers would de-
chunk the requests, so Django would see the full request, not chunks.
Maybe it would be good for Django to not follow the spec here, but if so,
it would probably be good to keep that in mind and explicitly say so in
the docs.
--
Ticket URL: <https://code.djangoproject.com/ticket/35838#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701928c72f7db-338a0deb-046f-478e-a1c2-8c522f8f4076-000000%40eu-central-1.amazonses.com.