Re-add a form of size limit
This commit is contained in:
parent
364d8bf006
commit
c4b57ac617
2 changed files with 8 additions and 0 deletions
|
@ -210,6 +210,10 @@ exports.getType = async (image) => {
|
|||
"Range": "bytes=0-1023"
|
||||
}});
|
||||
clearTimeout(timeout);
|
||||
if (parseInt(imageRequest.headers.get("Content-Range").split("/")[1]) > 20971520) {
|
||||
type = "large";
|
||||
return type;
|
||||
}
|
||||
const imageBuffer = await imageRequest.buffer();
|
||||
const imageType = await fileType.fromBuffer(imageBuffer);
|
||||
if (imageType && formats.includes(imageType.mime)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue