mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
cgi.FieldStorage.read_multi ignores Content-Length
Issue #24764: cgi.FieldStorage.read_multi() now ignores the Content-Length header in part headers. Patch written by Peter Landry and reviewed by Pierre Quentel.
This commit is contained in:
parent
2053aa1193
commit
6579459d4b
4 changed files with 29 additions and 0 deletions
|
@ -714,6 +714,11 @@ class FieldStorage:
|
|||
self.bytes_read += len(hdr_text)
|
||||
parser.feed(hdr_text.decode(self.encoding, self.errors))
|
||||
headers = parser.close()
|
||||
|
||||
# Some clients add Content-Length for part headers, ignore them
|
||||
if 'content-length' in headers:
|
||||
del headers['content-length']
|
||||
|
||||
part = klass(self.fp, headers, ib, environ, keep_blank_values,
|
||||
strict_parsing,self.limit-self.bytes_read,
|
||||
self.encoding, self.errors)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue