Skip to content

Commit

Permalink
Merge pull request #2773 from hazho/master
Browse files Browse the repository at this point in the history
Solving issue #2692
  • Loading branch information
benoitc committed Aug 25, 2022
2 parents 053e15c + 7d8f68c commit 0b953b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gunicorn/http/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ def sendfile(self, respiter):
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")
Expand Down

0 comments on commit 0b953b8

Please sign in to comment.