Skip to content

Commit

Permalink
Merge pull request #2688 from StarfishStorage/fix_2684
Browse files Browse the repository at this point in the history
Fix problem that may happen after interrupted chunk-encoding request
  • Loading branch information
benoitc authored Aug 6, 2024
2 parents c5727ac + c30b0d9 commit 52234e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gunicorn/http/body.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def parse_chunked(self, unreader):
# Remove \r\n after chunk
rest = rest[size:]
while len(rest) < 2:
rest += unreader.read()
new_data = unreader.read()
if not new_data:
break
rest += new_data
if rest[:2] != b'\r\n':
raise ChunkMissingTerminator(rest[:2])
(size, rest) = self.parse_chunk_size(unreader, data=rest[2:])
Expand Down

0 comments on commit 52234e7

Please sign in to comment.