digitalbazaar / digitalbazaar/http-client
Add support for `content-encoding` and compressed `response.body`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
This library fails if a route returns the following headers:
'content-type' => 'application/json; charset=utf-8 and
'content-encoding' => 'gzip',
In this case the response.body is gzipped json.
We need to support compressed response.bodies.
Note: Axios has an existing decompress function that appears to use zlib to automatically inflate compressed response.bodies.
Axios code here:
EDIT: content-encoding is part of the fetch spec so it appears that something is broken in node 18.8-18.9 that is causing this issue somewhere down the line. Close this issue when content-encoding is working again.
Contributor guide
No contributing guide indexed for this repository
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 inspecting the HTTP response handling and reproduce the case described with content-type application/json, content-encoding gzip, and a gzipped response.body. Compare the behavior with Axios's zlib-based decompression path across the noted Node 18.8-18.9 versions; done means compressed response bodies work, or the issue is confirmed to be an external Node regression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100