bpo-34226: fix cgi.parse_multipart without content_length by Roger · Pull Request #8530 · python/cpython

pablogsal

pablogsal

yan12125

twm added a commit to twisted/twisted that referenced this pull request

Dec 16, 2019

rodrigc pushed a commit to twisted/twisted that referenced this pull request

Mar 28, 2020
In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
header, this fix remove this header as required and fix FieldStorage
read_lines_to_outerboundary, by not using limit when it's negative,
since by default it's -1 if not content-length and keeps substracting what
was read from the file object.

Also added a test case for this problem.

@Roger

orsenthil

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Jun 15, 2020
)

In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
header, this fix remove this header as required and fix FieldStorage
read_lines_to_outerboundary, by not using limit when it's negative,
since by default it's -1 if not content-length and keeps substracting what
was read from the file object.

Also added a test case for this problem.
(cherry picked from commit d8cf351)

Co-authored-by: roger <rogerduran@gmail.com>

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Jun 15, 2020
)

In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
header, this fix remove this header as required and fix FieldStorage
read_lines_to_outerboundary, by not using limit when it's negative,
since by default it's -1 if not content-length and keeps substracting what
was read from the file object.

Also added a test case for this problem.
(cherry picked from commit d8cf351)

Co-authored-by: roger <rogerduran@gmail.com>

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Jun 15, 2020
)

In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
header, this fix remove this header as required and fix FieldStorage
read_lines_to_outerboundary, by not using limit when it's negative,
since by default it's -1 if not content-length and keeps substracting what
was read from the file object.

Also added a test case for this problem.
(cherry picked from commit d8cf351)

Co-authored-by: roger <rogerduran@gmail.com>

miss-islington added a commit that referenced this pull request

Jun 15, 2020
) (GH-20892)

In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
header, this fix remove this header as required and fix FieldStorage
read_lines_to_outerboundary, by not using limit when it's negative,
since by default it's -1 if not content-length and keeps substracting what
was read from the file object.

Also added a test case for this problem.
(cherry picked from commit d8cf351)


Co-authored-by: roger <rogerduran@gmail.com>

Automerge-Triggered-By: @ned-deily

miss-islington added a commit that referenced this pull request

Jun 15, 2020
In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
header, this fix remove this header as required and fix FieldStorage
read_lines_to_outerboundary, by not using limit when it's negative,
since by default it's -1 if not content-length and keeps substracting what
was read from the file object.

Also added a test case for this problem.
(cherry picked from commit d8cf351)

Co-authored-by: roger <rogerduran@gmail.com>

miss-islington added a commit that referenced this pull request

Jun 15, 2020
In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
header, this fix remove this header as required and fix FieldStorage
read_lines_to_outerboundary, by not using limit when it's negative,
since by default it's -1 if not content-length and keeps substracting what
was read from the file object.

Also added a test case for this problem.
(cherry picked from commit d8cf351)

Co-authored-by: roger <rogerduran@gmail.com>