#35289: Chunked transfer encoding is not handled correctly by MultiPartParser
-------------------------------------+-------------------------------------
Reporter: Kyle | Owner: nobody
Agronick |
Type: Bug | Status: new
Component: HTTP | Version: 5.0
handling | Keywords: transfer-encoding,
Severity: Normal | chunked, multi-part
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I am trying to post large files from C#. The C# implementation conforms to
the HTTP1.1 protocol and does not allow chunked transfer encoding and a
content-length to be set at the same time.
{{{
Messages MUST NOT include both a Content-Length header field and a non-
identity transfer-coding. If the message does include a non-identity
transfer-coding, the Content-Length MUST be ignored." (RFC 2616, Section
4.4)
}}}
In the `MultiPartParser` a non-existent content-length header is treated
as 0:
https://github.com/django/django/blob/main/django/http/multipartparser.py#L96
When the 0 length is read, nothing gets parsed:
https://github.com/django/django/blob/main/django/http/multipartparser.py#L147
If you remove the check in the second link, everything works correctly. It
works fine without an explicit content-length.
With Nginx to turn off request buffering for a single request you need to
use chunked transfer encoding.
--
Ticket URL: <https://code.djangoproject.com/ticket/35289>
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/0107018e2ec5acc9-bdbb3a38-4e8e-46d8-a0dd-6172730fcd7f-000000%40eu-central-1.amazonses.com.