diff options
author | Helmut Grohne <helmut@subdivi.de> | 2009-01-31 19:55:18 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2009-01-31 19:55:18 +0100 |
commit | d100de91eaf8cb22dc51670d8bad4fec9c87d8e8 (patch) | |
tree | e0e234ecf11ebbcf437827842e7f7dd97d1a67f8 | |
parent | df856b04a05511998bcd40b53d1c490492170798 (diff) | |
download | wsgitools-d100de91eaf8cb22dc51670d8bad4fec9c87d8e8.tar.gz |
StaticFile uses wsgi.file_wrapper from environ if possible
-rw-r--r-- | wsgitools/applications.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/wsgitools/applications.py b/wsgitools/applications.py index 33823bd..f90e395 100644 --- a/wsgitools/applications.py +++ b/wsgitools/applications.py @@ -127,6 +127,9 @@ class StaticFile: stream.close() return [] + if isinstance(self.filelike, basestring) and 'wsgi.file_wrapper' in environ: + return environ['wsgi.file_wrapper'](stream, self.blocksize) + if 0 <= size <= self.blocksize: data = stream.read(size) if isinstance(self.filelike, basestring): |