-
Notifications
You must be signed in to change notification settings - Fork 632
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
Allow HTTP1.1
, H2
, and H2C
protocol for HttpClient
#2659
Allow HTTP1.1
, H2
, and H2C
protocol for HttpClient
#2659
Conversation
@alextychan Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@alextychan Thank you for signing the Contributor License Agreement! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide also test that demonstrates how HTTP and HTTPS urls will behave when the client is configured with all 3 types of protocol?
reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClientConnect.java
Outdated
Show resolved
Hide resolved
reactor-netty-http/src/main/java/reactor/netty/http/client/HttpClientConnect.java
Outdated
Show resolved
Hide resolved
Enable H1, H2, and H2C protocols for HttpClient by dropping H2C protocol when handling HTTPS urls, and by dropping H2 protocol when handling HTTP urls when another protocol is present Signed-off-by: TaiYau Chan <alextychan@gmail.com>
232f38c
to
6241b24
Compare
I've only added tests for edge cases where the client is configured with all 3 types of protocol for the following cases.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alextychan Thanks for the PR
@reactor/netty-team PTAL
The failing QUIC tests on CI are not related |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good to me,
great patch; thanks @alextychan !
Enable H1, H2, and H2C protocols for HttpClient by dropping H2C protocol when handling HTTPS urls, and by dropping H2 protocol when handling HTTP urls when another protocol is present This is a backport for PR #2659 Signed-off-by: TaiYau Chan <alextychan@gmail.com>
HTTP1.1
, H2
, and H2C
protocol for HttpClient
Currently a client that's configured for HTTP 1.1, H2, and H2C is unable to make requests to both HTTPS and HTTP urls due to checks in HttpClientConnect.java which can be safely ignored as long as a backup protocol is configured.
The following changes are in line with discussion in this PR #1403. Specifically the table as follows.
H2
}http
H2
}https
H2
(pre-known)H2C
}http
H2C
(pre-known)H2C
}https
HTTP11
}http
HTTP11
HTTP11
}https
HTTP11
H2
,H2C
}http
H2C
(pre-known)H2
,H2C
}https
H2
(pre-known)H2
,HTTP11
}http
HTTP11
H2
,HTTP11
}https
H2
(offered via ALPN, fallback toHTTP11
)H2C
,HTTP11
}http
H2C
(offered viaUpgrade
header, fallback toHTTP11
)H2C
,HTTP11
}https
HTTP11
H2
,H2C
,HTTP11
}http
H2C
(offered viaUpgrade
header, fallback toHTTP11
).H2
,H2C
,HTTP11
}https
H2
(offered via ALPN, fallback toHTTP11
)This fix will allow clients configured with HTTP 1.1, H2, and H2C to work as expected by ignoring H2C in HTTPS, and by ignoring H2 in HTTP.