Long story short, I am using node-fetch to upload a file to a Rails server.
The file is from fs.createReadStream
= ReadStream.
https://github.com/node-fetch/node-fetch
Note: when body is a Stream, Content-Length is not set automatically.
As it says in the readme, when it's a stream, the request's content-length will not be set by node-fetch.
- When receiving the data with Rails v6, it somehow setups the request's content-length even though the client is not sending the length.
- When receiving the same data with Rails v5, it doesn't setup the content-length.
I am trying to monkey-patch v5 with what they did in v6.
Does anyone know how v6 does that?