From 8a5f3842fcfc176f5e95110bba59d86705f20268 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Wed, 9 Jan 2019 09:18:54 -0500 Subject: [PATCH] fix media type for files without extension --- lbrynet/extras/daemon/mime_types.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lbrynet/extras/daemon/mime_types.py b/lbrynet/extras/daemon/mime_types.py index e2c9667cd..844f61169 100644 --- a/lbrynet/extras/daemon/mime_types.py +++ b/lbrynet/extras/daemon/mime_types.py @@ -153,4 +153,5 @@ types_map = { def guess_media_type(path): _, ext = os.path.splitext(path) - return types_map.get(ext, f'application/x-ext-{ext}') + default = f'application/x-ext-{ext}' if ext else 'application/octet-stream' + return types_map.get(ext, default)