fetch raw bytes without decompressing (and sending accept-encoding)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 880
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 68
Description
This would solve...
Something that node-fetch have had is the possibility to avoid decompressing the body while also sending out accept-encoding. why would this be useful? if you make a request to abc.com on the behalf of a client (like in a proxy) and it respond with a content-length and a content-encoding then you wish to simply just send back all this response headers and pipe the data to back the client. but content-length will be a missmatch b/c the content-length will match the compressed size and what you are actually piping back to the client will be the uncompressed size
The implementation should look like...
I have also considered...
Additional context
node-fetch has compress: true but if i could rename it, then it would be decompressResponseBody: boolean and default that to true
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Undici's existing response decompression behavior and comparing it with node-fetch's compress option. Define how callers would request raw compressed bytes while still sending accept-encoding, including the expected handling of content-length and content-encoding; the work is done when that behavior is specified and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100