summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfbin.py3
1 files changed, 3 insertions, 0 deletions
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))])