diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-07-29 17:40:33 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-07-29 17:40:33 +0200 |
commit | ea31bb243b398e73f4a4bda46c1911ab0487ff3f (patch) | |
tree | 5ee5fc4c2557c26643fa861febaf961dfa0f68ec | |
parent | 0e936a1e55d0168b8d4af5e396bc8a22c7d260e2 (diff) |
Added support for X-Sendfile.
-rwxr-xr-x | fbin.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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))]) |