mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
handle size 0 read by returning empty buffer
It appears the original author meant to return b"" when size == 0 instead of raise ValueError("Size must be positive.")
This commit is contained in:
parent
174c34ec9c
commit
c2ae9090dc
@ -18,7 +18,7 @@ class ChunkedReader(object):
|
|||||||
def read(self, size):
|
def read(self, size):
|
||||||
if not isinstance(size, six.integer_types):
|
if not isinstance(size, six.integer_types):
|
||||||
raise TypeError("size must be an integral type")
|
raise TypeError("size must be an integral type")
|
||||||
if size <= 0:
|
if size < 0:
|
||||||
raise ValueError("Size must be positive.")
|
raise ValueError("Size must be positive.")
|
||||||
if size == 0:
|
if size == 0:
|
||||||
return b""
|
return b""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user