Struggling with Gzip Compression in HTTP Client Proxy Requests
I needed to proxy some request from a client to a 3rd party, I pipe the client response stream to the server response stream and..... borked. The body comes back gzip compressed, and fetch automatically decompresses the body so the content-length no longer match. Huh, funny I never thought about this behavior of the http client hahaha Well, all I need is just to disabl--- You can't disable that behavior on fetch, it's baked in. Oh no. I'm left with 3 horrible options 1. recompress before sending - really dumb 2. add another http client just for this one use-case - This is begging for bugs and confusion, no thx 3. change http clients- I use the http client everywhere, thats insane but my hands are tied
Wait, I'm using effect. I don't have a giant legacy mess of homebrew wrappers around
axios
axios
or
request
request
or
superagent
superagent
or
node-fetch
node-fetch
like I had in literally every node project in the last decade.
issue instantly and simply solved (plus accidentally its a perf boost lol) It's so hard to accurately portray to people how massive of a lifesaver that is. Who knows how many dev-hours this just saved me.