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

[Gateway MVC] ERR_HTTP2_PROTOCOL_ERROR if HTTP/2 enabled #3326

Closed
benba opened this issue Mar 28, 2024 · 2 comments
Closed

[Gateway MVC] ERR_HTTP2_PROTOCOL_ERROR if HTTP/2 enabled #3326

benba opened this issue Mar 28, 2024 · 2 comments

Comments

@benba
Copy link
Contributor

benba commented Mar 28, 2024

if server.http2.enabled is set to true, using JDK HttpClient, and if the downstream server also exchange in HTTP/2, a HTTP/2 protocol error will be raised (ERR_HTTP2_PROTOCOL_ERROR in Chrome for example).

curl gives more details about the issue:
PROTOCOL_ERROR Invalid HTTP header filed was received: frame type: 1, stream: 1, name: [:status], value: [200]

An easy workardound is to add a HttpHeadersFilter.ResponseHttpHeadersFilter that removes the :status pseudo-header.

I can submit a PR if you feel that it's an appropriate fix

@spencergibb
Copy link
Member

PRs welcome

@ebarliba
Copy link

For anyone stumbling upon this and looking for a workaround, I replaced the JDK HttpClient by adding Apache httpclient (org.apache.httpcomponents.client5:httpclient5) dependency and adding spring.cloud.gateway.mvc.http-client.type: autodetect.

@spencergibb spencergibb moved this to In Progress in 2023.0.4 Sep 26, 2024
@spencergibb spencergibb moved this to In Progress in 2024.0.0-M2 Sep 26, 2024
@spencergibb spencergibb added this to the 4.1.6 milestone Sep 26, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in 2023.0.4 Sep 26, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in 2024.0.0-M2 Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants