What problem are you trying to solve?
Safely retrieve content delivered from a server.
Describe the feature
Depending on how the stream is sent from the server, got will happily complete without error, even if the actual bytes transferred does not match the value in the content-length header.
While it is possible to workaround, and detect manually, it is quite cumbersome, especially if decompress is enabled.
FYI, it is not a problem when the server responds with content-encoding: chunked, since node will error if such a stream is interrupted.
Checklist
What problem are you trying to solve?
Safely retrieve content delivered from a server.
Describe the feature
Depending on how the stream is sent from the server, got will happily complete without error, even if the actual bytes transferred does not match the value in the
content-lengthheader.While it is possible to workaround, and detect manually, it is quite cumbersome, especially if
decompressis enabled.FYI, it is not a problem when the server responds with
content-encoding: chunked, since node will error if such a stream is interrupted.Checklist