diff options
author | ianb <devnull@localhost> | 2008-04-11 21:06:37 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2008-04-11 21:06:37 +0000 |
commit | 5a9c6ac6100b3214a62a35884319f0281179e1ef (patch) | |
tree | 35ff3c1ff9db7e730db79a81b5139af30e0526df /paste/fileapp.py | |
parent | 7bf252ce23dde542d0405f171ddd6e8f19dacd66 (diff) | |
download | paste-5a9c6ac6100b3214a62a35884319f0281179e1ef.tar.gz |
Use wsgi.file_wrapper when available
Diffstat (limited to 'paste/fileapp.py')
-rw-r--r-- | paste/fileapp.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/paste/fileapp.py b/paste/fileapp.py index e72db7f..e17600d 100644 --- a/paste/fileapp.py +++ b/paste/fileapp.py @@ -230,7 +230,11 @@ class FileApp(DataApp): if is_head: return [''] file.seek(lower) - return _FileIter(file, size=content_length) + file_wrapper = environ.get('wsgi.file_wrapper', None) + if file_wrapper: + return file_wrapper(file, BLOCK_SIZE) + else: + return _FileIter(file, size=content_length) class _FileIter(object): |