Closed Kuzzy closed 2 years ago
@Kuzzy agree, i will check this , i need to think a way of how to handle this scenarios properly, on top of my head i can think of set totalSize
as -1 value, when failed to fetch the content-length
, and set incomplete
to false, since this can't be determined
How about setting totalSize
to null
? The total size is "undefined" in this case, and null
is the explicit version of undefined
:)
Released on 2.0.1
If for some reasons target server will not return 'content-length' header for downloaded file, download info object will always have
incomplete: true
property, while file will be downloaded and written to filesystem. (https://github.com/hgouveia/node-downloader-helper/blob/master/src/index.js#L514)How to reproduce:
I think, that this behavior is wrong. 'content-length' header check should be optional because not every server will respond with this header.