From 652d7cbd24bf5862bb62ab92dc7ff0a336be6e4a Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Fri, 15 Feb 2019 18:30:37 -0500 Subject: [PATCH] consider . extension --- 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 c9f38ee7d..41ce4d5e9 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 = 'application/octet-stream' if not ext else f'application/x-ext-{ext[1:].strip().lower()}' + default = 'application/octet-stream' if not (ext and ext[1:].strip()) else f'application/x-ext-{ext[1:].strip().lower()}' return types_map.get(ext, default)