mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
static handler: if 'wsgi.file_wrapper' throws exception, default to streaming directly
This commit is contained in:
parent
e61078ab96
commit
bdf4f9bc71
@ -207,9 +207,15 @@ class StaticHandler(BaseHandler):
|
||||
data.seek(0)
|
||||
headers = [('Content-Length', str(size))]
|
||||
|
||||
reader = None
|
||||
|
||||
if 'wsgi.file_wrapper' in wbrequest.env:
|
||||
reader = wbrequest.env['wsgi.file_wrapper'](data)
|
||||
else:
|
||||
try:
|
||||
reader = wbrequest.env['wsgi.file_wrapper'](data)
|
||||
except:
|
||||
pass
|
||||
|
||||
if not reader:
|
||||
reader = iter(lambda: data.read(), b'')
|
||||
|
||||
content_type = 'application/octet-stream'
|
||||
|
Loading…
x
Reference in New Issue
Block a user