Skip to content

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

Open
@kolbma

Description

@kolbma

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-http2Area: HTTP/2 specific.A-serverArea: server.C-bugCategory: bug. Something is wrong. This is bad!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions