summaryrefslogtreecommitdiff
path: root/wsgitools
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2009-01-31 19:55:18 +0100
committerHelmut Grohne <helmut@subdivi.de>2009-01-31 19:55:18 +0100
commitd100de91eaf8cb22dc51670d8bad4fec9c87d8e8 (patch)
treee0e234ecf11ebbcf437827842e7f7dd97d1a67f8 /wsgitools
parentdf856b04a05511998bcd40b53d1c490492170798 (diff)
downloadwsgitools-d100de91eaf8cb22dc51670d8bad4fec9c87d8e8.tar.gz
StaticFile uses wsgi.file_wrapper from environ if possible
Diffstat (limited to 'wsgitools')
-rw-r--r--wsgitools/applications.py3
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):