1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-24 15:09:54 +01:00

static handler: add default 'application/octet-stream' and only set

guessed mime if not none
This commit is contained in:
Ilya Kreymer 2014-12-04 23:02:30 -08:00
parent c996e70a6e
commit ea89702701

View File

@ -193,7 +193,11 @@ class StaticHandler(BaseHandler):
else:
reader = iter(lambda: data.read(), '')
content_type, _ = mimetypes.guess_type(full_path)
content_type = 'application/octet-stream'
guessed = mimetypes.guess_type(full_path)
if guessed[0]:
content_type = guessed[0]
return WbResponse.text_stream(data,
content_type=content_type,