Don't download image contents during prefetch if not needed (#4363)
This commit is contained in:
parent
4419029d2e
commit
5f7ec9e8da
@ -403,7 +403,8 @@ function fetch(uri, headers) {
|
|||||||
if (imageTypeRegex.test(contentType)) {
|
if (imageTypeRegex.test(contentType)) {
|
||||||
// response is an image
|
// response is an image
|
||||||
// if Content-Length header reports a size exceeding the prefetch limit, abort fetch
|
// if Content-Length header reports a size exceeding the prefetch limit, abort fetch
|
||||||
if (contentLength > limit) {
|
// and if file is not to be stored we don't need to download further either
|
||||||
|
if (contentLength > limit || !Helper.config.prefetchStorage) {
|
||||||
gotStream.destroy();
|
gotStream.destroy();
|
||||||
}
|
}
|
||||||
} else if (mediaTypeRegex.test(contentType)) {
|
} else if (mediaTypeRegex.test(contentType)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user