Update ImageUtilities.plugin.js
This commit is contained in:
parent
db997fe33e
commit
85d9696121
|
@ -1439,7 +1439,9 @@ module.exports = (_ => {
|
||||||
|
|
||||||
downloadFileAs (url, fallbackUrl, alternativeName) {
|
downloadFileAs (url, fallbackUrl, alternativeName) {
|
||||||
url = url.startsWith("/assets") ? (window.location.origin + url) : url;
|
url = url.startsWith("/assets") ? (window.location.origin + url) : url;
|
||||||
BDFDB.LibraryRequires.request(url, {agentOptions: {rejectUnauthorized: false}, encoding: null}, (error, response, body) => {
|
BDFDB.LibraryRequires.request(url, {agentOptions: {rejectUnauthorized: false}, headers: {"Content-Type": "application/json"}}, (error, response, body) => {
|
||||||
|
console.log(body);
|
||||||
|
return;
|
||||||
let type = this.isValid(url, "video") ? BDFDB.LanguageUtils.LanguageStrings.VIDEO : BDFDB.LanguageUtils.LanguageStrings.IMAGE;
|
let type = this.isValid(url, "video") ? BDFDB.LanguageUtils.LanguageStrings.VIDEO : BDFDB.LanguageUtils.LanguageStrings.IMAGE;
|
||||||
if (error || response.statusCode != 200 || response.headers["content-type"].indexOf("text/html") > -1) {
|
if (error || response.statusCode != 200 || response.headers["content-type"].indexOf("text/html") > -1) {
|
||||||
if (fallbackUrl) this.downloadFileAs(fallbackUrl, null, alternativeName);
|
if (fallbackUrl) this.downloadFileAs(fallbackUrl, null, alternativeName);
|
||||||
|
|
Loading…
Reference in New Issue