From 229a69c3e418b98c40b22443b4cd54a6e910bb55 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Tue, 30 Aug 2022 07:34:32 +0200 Subject: [PATCH] Update ImageUtilities.plugin.js --- Plugins/ImageUtilities/ImageUtilities.plugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/ImageUtilities/ImageUtilities.plugin.js b/Plugins/ImageUtilities/ImageUtilities.plugin.js index f436374f9a..e76d0cac4b 100644 --- a/Plugins/ImageUtilities/ImageUtilities.plugin.js +++ b/Plugins/ImageUtilities/ImageUtilities.plugin.js @@ -1433,7 +1433,7 @@ module.exports = (_ => { url = url.startsWith("/assets") ? (window.location.origin + url) : url; BDFDB.LibraryRequires.request(url, {agentOptions: {rejectUnauthorized: false}, encoding: null}, (error, response, body) => { let type = this.isValid(url, "video") ? BDFDB.LanguageUtils.LanguageStrings.VIDEO : BDFDB.LanguageUtils.LanguageStrings.IMAGE; - if (error || response.statusCode != 200 || response.headers["content-type"] == "text/html") { + if (error || response.statusCode != 200 || response.headers["content-type"].indexOf("text/html") > -1) { if (fallbackUrl) this.downloadFile(fallbackUrl, path, null, alternativeName); else BDFDB.NotificationUtils.toast(this.labels.toast_save_failed.replace("{{var0}}", type).replace("{{var1}}", ""), {type: "danger"}); } @@ -1450,7 +1450,7 @@ module.exports = (_ => { url = url.startsWith("/assets") ? (window.location.origin + url) : url; BDFDB.LibraryRequires.request(url, {agentOptions: {rejectUnauthorized: false}, encoding: null}, (error, response, body) => { let type = this.isValid(url, "video") ? BDFDB.LanguageUtils.LanguageStrings.VIDEO : BDFDB.LanguageUtils.LanguageStrings.IMAGE; - if (error || response.statusCode != 200 || response.headers["content-type"] == "text/html") { + if (error || response.statusCode != 200 || response.headers["content-type"].indexOf("text/html") > -1) { if (fallbackUrl) this.downloadFileAs(fallbackUrl, null, alternativeName); else BDFDB.NotificationUtils.toast(this.labels.toast_save_failed.replace("{{var0}}", type).replace("{{var1}}", ""), {type: "danger"}); }