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 CloseableHttpAsyncClient build() {
} }
} }
b.addAll( b.addAll(
new H2RequestTargetHost(),
new RequestDefaultHeaders(defaultHeaders), new RequestDefaultHeaders(defaultHeaders),
new RequestUserAgent(userAgentCopy), new RequestUserAgent(userAgentCopy),
new RequestExpectContinue(), new RequestExpectContinue(),
new H2RequestContent(), new H2RequestContent(),
new H2RequestTargetHost(),
new H2RequestConnControl()); new H2RequestConnControl());
if (!cookieManagementDisabled) { if (!cookieManagementDisabled) {
b.add(RequestAddCookies.INSTANCE); b.add(RequestAddCookies.INSTANCE);

View File

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

View File

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