HTTPCLIENT-2232: last protocol interceptrs moved at the end of the H2 protocol processing pipeline

This commit is contained in:
Oleg Kalnichevski 2022-09-11 18:50:45 +02:00
parent ed7701c509
commit 9c0575494a
2 changed files with 10 additions and 4 deletions

View File

@ -688,7 +688,10 @@ public CloseableHttpAsyncClient build() {
b.addAll(
new RequestDefaultHeaders(defaultHeaders),
new RequestUserAgent(userAgentCopy),
new RequestExpectContinue());
new RequestExpectContinue(),
new H2RequestContent(),
new H2RequestTargetHost(),
new H2RequestConnControl());
if (!cookieManagementDisabled) {
b.add(RequestAddCookies.INSTANCE);
}
@ -766,7 +769,7 @@ public CloseableHttpAsyncClient build() {
final AsyncPushConsumerRegistry pushConsumerRegistry = new AsyncPushConsumerRegistry();
final IOEventHandlerFactory ioEventHandlerFactory = new H2AsyncClientProtocolStarter(
new DefaultHttpProcessor(new H2RequestContent(), new H2RequestTargetHost(), new H2RequestConnControl()),
HttpProcessorBuilder.create().build(),
(request, context) -> pushConsumerRegistry.get(request),
h2Config != null ? h2Config : H2Config.DEFAULT,
charCodingConfig != null ? charCodingConfig : CharCodingConfig.DEFAULT);

View File

@ -820,7 +820,10 @@ public CloseableHttpAsyncClient build() {
b.addAll(
new RequestDefaultHeaders(defaultHeaders),
new RequestUserAgent(userAgentCopy),
new RequestExpectContinue());
new RequestExpectContinue(),
new H2RequestContent(),
new H2RequestTargetHost(),
new H2RequestConnControl());
if (!cookieManagementDisabled) {
b.add(RequestAddCookies.INSTANCE);
}
@ -934,7 +937,7 @@ public CloseableHttpAsyncClient build() {
}
final AsyncPushConsumerRegistry pushConsumerRegistry = new AsyncPushConsumerRegistry();
final IOEventHandlerFactory ioEventHandlerFactory = new HttpAsyncClientProtocolNegotiationStarter(
new DefaultHttpProcessor(new H2RequestContent(), new H2RequestTargetHost(), new H2RequestConnControl()),
HttpProcessorBuilder.create().build(),
(request, context) -> pushConsumerRegistry.get(request),
h2Config != null ? h2Config : H2Config.DEFAULT,
h1Config != null ? h1Config : Http1Config.DEFAULT,