Merge pull request #2773 from hazho/master

Solving issue #2692
This commit is contained in:
Benoit Chesneau 2022-08-25 14:19:45 +02:00 committed by GitHub
commit 0b953b8037
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -371,8 +371,8 @@ class Response(object):
if self.is_chunked():
chunk_size = "%X\r\n" % nbytes
self.sock.sendall(chunk_size.encode('utf-8'))
self.sock.sendfile(respiter.filelike, count=nbytes)
if nbytes > 0:
self.sock.sendfile(respiter.filelike, count=nbytes)
if self.is_chunked():
self.sock.sendall(b"\r\n")