hyperium / hyperium/hyper

Different behavior on invalid URIs between HTTP/1 and HTTP/2

Open
#2,736 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-http2 A-server C-bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.