Acccount for cases where Content-Range doesn't exist
This commit is contained in:
parent
787eb347f6
commit
21a98e216d
1 changed files with 2 additions and 1 deletions
|
@ -204,7 +204,8 @@ exports.getType = async (image) => {
|
|||
"Range": "bytes=0-1023"
|
||||
}});
|
||||
clearTimeout(timeout);
|
||||
if (parseInt(imageRequest.headers.get("Content-Range").split("/")[1]) > 20971520) {
|
||||
const size = imageRequest.headers.has("Content-Range") ? imageRequest.headers.get("Content-Range").split("/")[1] : imageRequest.headers.get("Content-Length");
|
||||
if (parseInt(size) > 20971520) {
|
||||
type = "large";
|
||||
return type;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue