From 249c2d11a1301767f58988094ba470878b83be1e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 23 Feb 2025 18:34:28 +0530 Subject: [PATCH] Edit book: Download external resources: Fix incorrect filename if the server returns a generic Content-Type header Fix #2099754 [Private bug](https://bugs.launchpad.net/calibre/+bug/2099754) --- src/calibre/ebooks/oeb/polish/download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/oeb/polish/download.py b/src/calibre/ebooks/oeb/polish/download.py index ff3c782382..31c74cfcee 100644 --- a/src/calibre/ebooks/oeb/polish/download.py +++ b/src/calibre/ebooks/oeb/polish/download.py @@ -62,7 +62,7 @@ def get_filename(original_url_parsed, response): ct = headers.get_params()[0][0].lower() except Exception: ct = '' - if ct: + if ct and ct != 'application/octet-stream': mt = guess_type(ans) if mt != ct: exts = mimetypes.guess_all_extensions(ct)