You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2020/10/22 15:42:31 UTC
[httpcomponents-client] branch 5.0.x updated: HTTPCLIENT-2122:
async client to throw `HTTP/2 tunneling not supported` protocol exception
in case of `force HTTP/2` version policy used along with request proxy
routing
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch 5.0.x
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
The following commit(s) were added to refs/heads/5.0.x by this push:
new 6cd1573 HTTPCLIENT-2122: async client to throw `HTTP/2 tunneling not supported` protocol exception in case of `force HTTP/2` version policy used along with request proxy routing
6cd1573 is described below
commit 6cd1573a5d9aa17e8b3b0e456857813dae476ba2
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Thu Oct 22 17:38:43 2020 +0200
HTTPCLIENT-2122: async client to throw `HTTP/2 tunneling not supported` protocol exception in case of `force HTTP/2` version policy used along with request proxy routing
---
.../org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java
index 42518aa..60c95f5 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/InternalHttpAsyncClient.java
@@ -45,7 +45,6 @@ import org.apache.hc.core5.annotation.Internal;
import org.apache.hc.core5.annotation.ThreadingBehavior;
import org.apache.hc.core5.http.HttpException;
import org.apache.hc.core5.http.HttpHost;
-import org.apache.hc.core5.http.HttpVersion;
import org.apache.hc.core5.http.ProtocolVersion;
import org.apache.hc.core5.http.config.Lookup;
import org.apache.hc.core5.http.nio.AsyncPushConsumer;
@@ -105,7 +104,7 @@ public final class InternalHttpAsyncClient extends InternalAbstractHttpAsyncClie
HttpRoute determineRoute(final HttpHost httpHost, final HttpClientContext clientContext) throws HttpException {
final HttpRoute route = routePlanner.determineRoute(httpHost, clientContext);
final ProtocolVersion protocolVersion = clientContext.getProtocolVersion();
- if (route.isTunnelled() && protocolVersion.greaterEquals(HttpVersion.HTTP_2_0)) {
+ if (route.isTunnelled() && versionPolicy == HttpVersionPolicy.FORCE_HTTP_2) {
throw new HttpException("HTTP/2 tunneling not supported");
}
return route;