fedimbed: dont error on weird attachment structures
This commit is contained in:
parent
12f410a1cb
commit
70e7fdee04
1 changed files with 5 additions and 1 deletions
|
@ -508,7 +508,7 @@ async function processUrl(msg, url, spoiler = false) {
|
||||||
type: attachment.mediaType,
|
type: attachment.mediaType,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else if (attachment.url) {
|
||||||
const contentType = await fetch(attachment.url, {
|
const contentType = await fetch(attachment.url, {
|
||||||
method: "HEAD",
|
method: "HEAD",
|
||||||
}).then((res) => res.headers.get("Content-Type"));
|
}).then((res) => res.headers.get("Content-Type"));
|
||||||
|
@ -572,6 +572,10 @@ async function processUrl(msg, url, spoiler = false) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
logger.warn(
|
||||||
|
`Unhandled attachment structure! ${JSON.stringify(attachment)}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue