fedimbed: stop trying to blob a HEAD for size

This commit is contained in:
Cynthia Foxwell 2023-01-22 17:42:52 -07:00
parent dff6bb3e27
commit ea21e71c10

View file

@ -454,9 +454,7 @@ async function processUrl(msg, url, spoiler = false) {
headers: {
"User-Agent": FRIENDLY_USERAGENT,
},
})
.then((res) => res.blob())
.then((blob) => blob.size);
}).then((res) => Number(res.headers.get("Content-Length")));
if (size <= getUploadLimit(msg.channel.guild)) {
const file = await fetch(attachment.url, {
@ -487,9 +485,7 @@ async function processUrl(msg, url, spoiler = false) {
headers: {
"User-Agent": FRIENDLY_USERAGENT,
},
})
.then((res) => res.blob())
.then((blob) => blob.size);
}).then((res) => Number(res.headers.get("Content-Length")));
if (size <= getUploadLimit(msg.channel.guild)) {
const file = await fetch(attachment.url, {