From ea31bb243b398e73f4a4bda46c1911ab0487ff3f Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Fri, 29 Jul 2011 17:40:33 +0200 Subject: Added support for X-Sendfile. --- fbin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fbin.py b/fbin.py index bae6434..e0d70d8 100755 --- a/fbin.py +++ b/fbin.py @@ -143,6 +143,9 @@ class Application(object): return [] mime = mimetypes.guess_type(file.filename, strict = False)[0] or 'application/octet-stream' + if settings.use_xsendfile: + start_response('200 OK', [('X-Sendfile', filename.encode('utf8')), ('Last-Modified', file.date.strftime(rfc1123_format))]) + return [] start_response('200 OK', [('Content-Type', mime), ('Content-Length', str(os.path.getsize(filename))), ('Last-Modified', file.date.strftime(rfc1123_format))]) -- cgit v1.2.3