From 2fe4ad72ca467fd8da27701b1174097cb0c2957c Mon Sep 17 00:00:00 2001 From: Hannes Uebelacker Date: Mon, 4 Jan 2016 14:11:15 +0100 Subject: [PATCH] fix http.wsgi.Response.sendfile --- gunicorn/http/wsgi.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gunicorn/http/wsgi.py b/gunicorn/http/wsgi.py index 6ca3b4fb7..c0569834b 100644 --- a/gunicorn/http/wsgi.py +++ b/gunicorn/http/wsgi.py @@ -353,7 +353,9 @@ def sendfile(self, respiter): if self.cfg.is_ssl or not self.can_sendfile(): return False - if not util.has_fileno(respiter.filelike): + if util.has_fileno(respiter.filelike): + fileno = respiter.filelike.fileno() + else: return False try: