aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/cgi.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-xLib/cgi.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py
index 6959c9e5dbd..45badf6cc64 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -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)