This line https://github.com/itinance/react-native-fs/blob/64aa755cc1d37f59fa205bf2d52dd71a7d691504/windows/RNFS/RNFSManager.cpp#L947 assumes that there's always a content-length header returned as part of a http request, but if the client has issued an Accept-Encoding: gzip, deflate, br header, then the content-length header will be missing from the server, because the server has entered streaming mode, returning an on-the-fly compressed response, where the content-length can't be known in advance.
The lack of the content-length causes the library to crash in these cases.
Here's a curl session where the content-length is returned:
This line https://github.com/itinance/react-native-fs/blob/64aa755cc1d37f59fa205bf2d52dd71a7d691504/windows/RNFS/RNFSManager.cpp#L947 assumes that there's always a
content-length
header returned as part of a http request, but if the client has issued anAccept-Encoding: gzip, deflate, br
header, then the content-length header will be missing from the server, because the server has entered streaming mode, returning an on-the-fly compressed response, where the content-length can't be known in advance.The lack of the
content-length
causes the library to crash in these cases.Here's a curl session where the content-length is returned:
and here's the same request when the client says it can take a compressed response:
no content-length is present