diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-04-09 09:09:48 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2021-04-09 09:10:15 +0200 |
commit | 90774f0dc66fa425c7f066271b43d52ae4bc4eb5 (patch) | |
tree | 193f22ae274b712957d62e91b072036dedaa2415 /http-utils | |
parent | e9997174bd966ae60c3aacbc3fa3f9a7b8367d43 (diff) |
Allow 'https' in scheme
Diffstat (limited to 'http-utils')
-rw-r--r-- | http-utils/src/main/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlanner.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/http-utils/src/main/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlanner.java b/http-utils/src/main/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlanner.java index b21fdcd8cbc..92cc35fc354 100644 --- a/http-utils/src/main/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlanner.java +++ b/http-utils/src/main/java/ai/vespa/util/http/hc5/HttpToHttpsRoutePlanner.java @@ -2,8 +2,6 @@ package ai.vespa.util.http.hc5; import org.apache.hc.client5.http.HttpRoute; -import org.apache.hc.client5.http.impl.DefaultSchemePortResolver; -import org.apache.hc.client5.http.impl.routing.DefaultRoutePlanner; import org.apache.hc.client5.http.protocol.HttpClientContext; import org.apache.hc.client5.http.routing.HttpRoutePlanner; import org.apache.hc.core5.http.HttpException; @@ -20,8 +18,8 @@ class HttpToHttpsRoutePlanner implements HttpRoutePlanner { @Override public HttpRoute determineRoute(HttpHost target, HttpContext context) throws HttpException { - if ( ! target.getSchemeName().equals("http")) - throw new IllegalArgumentException("Scheme must be 'http' when using HttpToHttpsRoutePlanner, was '" + target.getSchemeName() + "'"); + if ( ! target.getSchemeName().equals("http") && ! target.getSchemeName().equals("https")) + throw new IllegalArgumentException("Scheme must be 'http' or 'https' when using HttpToHttpsRoutePlanner, was '" + target.getSchemeName() + "'"); if (target.getPort() == -1) throw new IllegalArgumentException("Port must be set when using HttpToHttpsRoutePlanner"); |