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

Open
benba opened this issue Mar 28, 2024 · 2 comments · May be fixed by #3369
Open

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

benba opened this issue Mar 28, 2024 · 2 comments · May be fixed by #3369

Comments

@benba
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants