Update ImageUtilities.plugin.js
This commit is contained in:
parent
d96f9f2ecf
commit
229a69c3e4
|
@ -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"});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue