content-length disincluded on streamed responses
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 598
- Forks
- 168
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 86
Description
Several years there was an issue with content-length being incorrect on streamed responses. This was causing clients, e.g. dnf to fail (which they should). The content length was wrong because it was the length of the encoded content received from the upstream payload, yet when we sent the payload to the client (our response) it isn't encoded the same.
The bugfix put in place was this.
If I read this right, on streamed responses we never include content-length. That seems wrong when there are cases where we can.
What if instead of disabling the Content-Length header by adding it to the hop_by_hop list of headers that we ignore, instead, we add only disable Content-Length in cases where Content-Encoding is also specified.
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 commit 4816f3326879be54da0ac4577a44ba35b4d69de5 and the streamed-response header handling it changed. Trace how Content-Length and Content-Encoding are processed for streamed responses; done means Content-Length is retained when it accurately describes the client payload and omitted when encoding makes it unreliable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100