`Connection` doesn't offer any way to iterate its contents
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with the headers::Connection API and its private AsConnectionOption type, then inspect how HeaderMap is expected to support removing referenced headers. Define how callers can iterate the connection options and access the option type, and add coverage showing that the contents can be inspected for gateway processing.
Written by the indexing model from the issue text.
Description
The Connection header lets me test if it contains specific "connection options"[^1] are contained in it. But it doesn't let me actually iterate its contents to see what it contains.
This is very frustrating as I need to actually know what's in the header because I'm implementing a gateway and I need to strip the referenced header names from the request I'm proxying. I would really like to be able to use headers::Connection so I don't have to worry about parsing the comma-separated list myself.
In theory I could just parse the header and then walk the whole headers map and compare each entry to the Connection, except HeaderMap does not offer a retain() operation and so that approach would require reallocating the whole map even if I don't end up making any changes.
[^1]: This is represented as a private impl AsConnectionOption type, which means it's undocumented. Really that should be changed so AsConnectionOption is public and simply inherits from a sealed trait, so the generated docs will at least tell me what implements it. Or maybe change it to use impl AsRef<str> instead, or even impl AsRef<[u8]> as that supports the required comparison too.
- Dominant language
- Rust
- Stars
- 200
- Forks
- 107
- PR merge metrics
- No merged PRs in 30d
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.
More from hyperium/headers
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Link support Open
Difficulty 4/5 3-5 days Newbie friendliness 38/100
All issues in hyperium/headers
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
issue
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
web-infra-dev/rspack#15847 ·