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

Remove connection-specific headeres for HTTP/2 and HTTP/3 #659

Merged
merged 3 commits into from
Jan 15, 2021

Conversation

MihaZupan
Copy link
Member

Fixes #583

YARP workaround for dotnet/aspnetcore#24543 that was merged into 6.0 in Kestrel.

@MihaZupan MihaZupan added this to the YARP 1.0.0-preview8 milestone Jan 12, 2021
Copy link
Member

@Tratcher Tratcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This handles h2 response protocol correctness but there are more scenarios to consider. https://tools.ietf.org/html/rfc7230#section-6.1 says we should remove the Connection header from all requests and responses, and all headers referenced by that (e.g. forwarding Connection: close would be bad for proxy scenarios). However, removing Connection: Upgrade would break WebSockets.

src/ReverseProxy/Utilities/RequestUtilities.cs Outdated Show resolved Hide resolved
@Tratcher
Copy link
Member

We also need to test what happens for requests. Does HttpClient filter out these headers on h2/3?

@MihaZupan
Copy link
Member Author

This PR specifically fixes the Http2 client => Http11 backend scenario described in #583.

Should the connection header (#439) be dealt-with in the same PR?

@Tratcher
Copy link
Member

Tratcher commented Jan 12, 2021

This PR should also cover the request version of the #583 scenario.

Do some reading about the Connection header and decide if you want to handle that at the same time or as a separate issue/PR. I'd forgotten we had a separate issue to track that already.

@Tratcher
Copy link
Member

That's good. HttpClient doesn't skip the Keep-Alive header?

Copy link
Member

@Tratcher Tratcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Keep-Alive question can be investigated separately.

@MihaZupan MihaZupan merged commit 5b48e37 into microsoft:master Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTP/2 connection to YARP with HTTP/1.1 to backend fails
2 participants