#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):
> _even if_ one would say that Django cannot read from a request's body on
the application-side of WSGI, as per the WSGI spec, that does not imply
Django should just silently throw away the data for that case. Would
raising an exception not be much better?
Yes, I agree - if Django can see that there is data, but it's not correct
according to the spec, it would be better to raise an exception than
silently throw away that data.
> does the "solution" (workaround) that I proposed (and for my own
project: implemented) have any actual downsides other than not following
the WSGI spec? I have personal reasons to ask, but the answer would also
be generally useful in telling us whether it's a viable general solution
I don't know - it would need to be analyzed, tested, ... One immediate
question to answer would be whether it causes any problems for WSGI
servers that implement the spec correctly. (Note: if you think that the
WSGI spec **does** allow for chunked transfer encoding at the Django app
level, you can also try to convince people of that.)
One thing you could try is to open a PR that implements the change you
want to make in Django, and let people give feedback on it and see if they
like it.
--
Ticket URL: <https://code.djangoproject.com/ticket/35838#comment:11>
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/010701928cd14d78-e7186da0-576a-422c-bd73-af70e0231231-000000%40eu-central-1.amazonses.com.