From 0b271ae5951e4ceb015571cbbcf2004041092288 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 6ca3b4fb7b..c0569834b7 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: