mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-31 03:04:12 +02:00
static handler: add default 'application/octet-stream' and only set
guessed mime if not none
This commit is contained in:
parent
c996e70a6e
commit
ea89702701
@ -193,7 +193,11 @@ class StaticHandler(BaseHandler):
|
|||||||
else:
|
else:
|
||||||
reader = iter(lambda: data.read(), '')
|
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,
|
return WbResponse.text_stream(data,
|
||||||
content_type=content_type,
|
content_type=content_type,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user