mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Empty chunks incorrectly signal end of response.
If an app iterator attempts to send an empty string to the client while using chunked transfer encoding it incorrectly signals the end of the transfer. This patch just ignores empty strings that are yielded by the application.
This commit is contained in:
parent
c71b9a88c2
commit
d83c63429e
@ -244,6 +244,11 @@ class Response(object):
|
||||
if tosend < arglen:
|
||||
arg = arg[:tosend]
|
||||
|
||||
# Sending an empty chunk signals the end of the
|
||||
# response and prematurely closes the response
|
||||
if self.chunked and tosend == 0:
|
||||
return
|
||||
|
||||
self.sent += tosend
|
||||
util.write(self.sock, arg, self.chunked)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user