Different behavior on invalid URIs between HTTP/1 and HTTP/2
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.3k
- Forks
- 1.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 14
Description
Version
v0.14.16
Platform
Linux
Description
When requesting an invalid Uri like GET %2Fhello%2Fworld on an hyper HTTP/1.1 connection the service function doesn't get called and hyper itself returns a BadRequest reponse.
In a HTTP/2 connection the hyper.uri is set to something like http://127.0.0.1:8000%2Fhello%2Fworld (without slash after port) and this gets passed to the service function.
hyper.uri.path_and_query() makes from this magically /%2Fhello%2Fworld (now with slash).
I tried this code:
https://github.com/kolbma/rocket-issues/tree/main/issue1994
I expected to see this happen: hyper should handle it with HTTP/2 the same way like with HTTP/1.1
Instead, this happened: See description
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 with the reproduction linked in the issue and compare how invalid URIs are handled on HTTP/1.1 and HTTP/2. Trace the hyper.uri and path_and_query() behavior for GET %2Fhello%2Fworld; done means HTTP/2 rejects the request consistently with HTTP/1.1 instead of invoking the service.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100