This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author quentel
Recipients Peter Landry, quentel, vstinner
Date 2015-08-07.10:47:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
I don't really see why there is a Content-Length in the headers of a
multipart form data. The specification at doesn't
mention it, and it is absent in the example that looks like the one tested
by Peter :

Content-Type: multipart/form-data; boundary=AaB03x
Content-Disposition: form-data; name="submit-name"

Content-Disposition: form-data; name="files"; filename="file1.txt"
Content-Type: text/plain
... contents of file1.txt ...

In case a user agent would insert it, I think the best would be to
ignore it. That is, inside read_multi(), after

            headers = parser.close()

add these lines :

            if 'content-length' in headers:
                del headers['content-length']

It's hard to see the potential side effects but I think it's cleaner
than the proposed patch, which is not correct anyway for another
reason : the attribute value is set to a bytes objects, instead of a

Peter, does this make sense ? If so, can you submit another patch ?
Date User Action Args
2015-08-07 10:48:00quentelsetrecipients: + quentel, vstinner, Peter Landry
2015-08-07 10:48:00quentellinkissue24764 messages
2015-08-07 10:47:58quentelcreate