Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jetty rejects encoded URIs with HTTP/2 #7766

Closed
npantelic opened this issue Mar 22, 2022 · 4 comments
Closed

Jetty rejects encoded URIs with HTTP/2 #7766

npantelic opened this issue Mar 22, 2022 · 4 comments
Labels
Bug For general bugs on Jetty side

Comments

@npantelic
Copy link

npantelic commented Mar 22, 2022

Jetty version(s)
9.4.44.v20210927

Java version/vendor
Open JDK version 11.0.14.1

OS type/version
Both MacOS and Linux.

Description
Jetty does not accept encoded URIs over HTTP/2. It returns <h1>Bad Message 400</h1><pre>reason: Ambiguous path separator</pre>

How to reproduce?

  • Use HTTP/2 connector (with ALPN; in my case with chained protocols h2, h2-17, http/1.1).
  • Encode URI - / -> %2f
  • Jetty returns <h1>Bad Message 400</h1><pre>reason: Ambiguous path separator</pre>

Notes:

  • with HTTP/1.1 it works just fine (with default http compliance mode)
  • URIs in canonical form does not make a problem
    • https://{host}:{port}/path%2Fsomething%2fsomethingelse -> works with HTTP/1.1, but not with HTTP/2
    • https://{host}:{port}/path/something/somethingelse-> works with both HTTP/1.1 and HTTP/2
  • other encoded chars also make a problem

Could http compliance mode be set on http 2 connection factory or is there any workaround. Is this a known issue?

@npantelic npantelic added the Bug For general bugs on Jetty side label Mar 22, 2022
@joakime
Copy link
Contributor

joakime commented Mar 22, 2022

Seems that Issue #7710 is related

@joakime
Copy link
Contributor

joakime commented Mar 22, 2022

Or you can move to Jetty 10.0.x which has HttpCompliance and UriCompliance across all Connection Factories.

@sbordet
Copy link
Contributor

sbordet commented Mar 23, 2022

Duplicate of #7710.

@sbordet sbordet closed this as completed Mar 23, 2022
@npantelic
Copy link
Author

@joakime Thanks for the answer, it helped 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
Development

No branches or pull requests

3 participants