From 43b372c0feb0881b81bd4668e76b76daf09bed5c Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Fri, 15 Feb 2019 18:13:00 -0500 Subject: [PATCH] fix extension - remove dot The rest of our extensions don't have a dot. Also, strip off any characters and lowercase it to be safe. --- lbrynet/extras/daemon/mime_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbrynet/extras/daemon/mime_types.py b/lbrynet/extras/daemon/mime_types.py index df182d2c2..c9f38ee7d 100644 --- a/lbrynet/extras/daemon/mime_types.py +++ b/lbrynet/extras/daemon/mime_types.py @@ -154,5 +154,5 @@ types_map = { def guess_media_type(path): _, ext = os.path.splitext(path) - default = f'application/x-ext-{ext}' if ext else 'application/octet-stream' + default = 'application/octet-stream' if not ext else f'application/x-ext-{ext[1:].strip().lower()}' return types_map.get(ext, default)