HTTPCLIENT-2293: client protocol handlers to try to send `Host` as the first header in the request header section per RFC 9110 section 7.2

This commit is contained in:
Oleg Kalnichevski 2023-10-09 11:08:27 +02:00
parent 152ba4736f
commit 4b7986370f
3 changed files with 3 additions and 3 deletions

View File

@ -684,11 +684,11 @@ public class H2AsyncClientBuilder {
}
}
b.addAll(
new H2RequestTargetHost(),
new RequestDefaultHeaders(defaultHeaders),
new RequestUserAgent(userAgentCopy),
new RequestExpectContinue(),
new H2RequestContent(),
new H2RequestTargetHost(),
new H2RequestConnControl());
if (!cookieManagementDisabled) {
b.add(RequestAddCookies.INSTANCE);

View File

@ -832,11 +832,11 @@ public class HttpAsyncClientBuilder {
}
}
b.addAll(
new H2RequestTargetHost(),
new RequestDefaultHeaders(defaultHeaders),
new RequestUserAgent(userAgentCopy),
new RequestExpectContinue(),
new H2RequestContent(),
new H2RequestTargetHost(),
new H2RequestConnControl());
if (!cookieManagementDisabled) {
b.add(RequestAddCookies.INSTANCE);

View File

@ -113,8 +113,8 @@ public final class HttpAsyncClients {
private static HttpProcessor createMinimalProtocolProcessor() {
return new DefaultHttpProcessor(
new H2RequestContent(),
new H2RequestTargetHost(),
new H2RequestContent(),
new H2RequestConnControl(),
new RequestUserAgent(VersionInfo.getSoftwareInfo(
"Apache-HttpAsyncClient", "org.apache.hc.client5", HttpAsyncClients.class)));