From 5ff0ce4142ec7a18f9f24fae65a62bac1971776c Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Wed, 29 Jul 2020 22:22:14 +1000 Subject: [PATCH] Issue #5044 - implement is secure on DelegatedJettyClientUpgradeRequest Signed-off-by: Lachlan Roberts --- .../client/impl/DelegatedJettyClientUpgradeRequest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/DelegatedJettyClientUpgradeRequest.java b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/DelegatedJettyClientUpgradeRequest.java index bdd1a38227d..d45dd692ea4 100644 --- a/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/DelegatedJettyClientUpgradeRequest.java +++ b/jetty-websocket/websocket-jetty-client/src/main/java/org/eclipse/jetty/websocket/client/impl/DelegatedJettyClientUpgradeRequest.java @@ -27,6 +27,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.http.HttpField; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.io.EndPoint; @@ -163,8 +164,7 @@ public class DelegatedJettyClientUpgradeRequest implements UpgradeRequest @Override public boolean isSecure() { - // TODO: figure out how to obtain from HttpClient's HttpRequest - return false; + return HttpClient.isSchemeSecure(delegate.getScheme()); } @Override @@ -204,7 +204,7 @@ public class DelegatedJettyClientUpgradeRequest implements UpgradeRequest if (rawExtensions == null || rawExtensions.isEmpty()) return Collections.emptyList(); - return rawExtensions.stream().map((parameterizedName) -> ExtensionConfig.parse(parameterizedName)).collect(Collectors.toList()); + return rawExtensions.stream().map(ExtensionConfig::parse).collect(Collectors.toList()); } @Override