knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject knox git commit: KNOX-950 - Fix a bug that prevents wss:// protocol from connection to websocket backend.
Date Thu, 25 May 2017 18:31:32 GMT
Repository: knox
Updated Branches:
  refs/heads/master dc0042e67 -> 5022bb43a


KNOX-950 - Fix a bug that prevents wss:// protocol from connection to websocket backend.


Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/5022bb43
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/5022bb43
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/5022bb43

Branch: refs/heads/master
Commit: 5022bb43aff894fe5f596a8f5ad551693a48deab
Parents: dc0042e
Author: Sandeep More <more@apache.org>
Authored: Thu May 25 14:31:28 2017 -0400
Committer: Sandeep More <more@apache.org>
Committed: Thu May 25 14:31:28 2017 -0400

----------------------------------------------------------------------
 .../hadoop/gateway/websockets/GatewayWebsocketHandler.java       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/5022bb43/gateway-server/src/main/java/org/apache/hadoop/gateway/websockets/GatewayWebsocketHandler.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/websockets/GatewayWebsocketHandler.java
b/gateway-server/src/main/java/org/apache/hadoop/gateway/websockets/GatewayWebsocketHandler.java
index a0c7f5f..9a7bf19 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/websockets/GatewayWebsocketHandler.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/websockets/GatewayWebsocketHandler.java
@@ -54,6 +54,8 @@ public class GatewayWebsocketHandler extends WebSocketHandler
       .get(WebsocketLogMessages.class);
 
   public static final String WEBSOCKET_PROTOCOL_STRING = "ws://";
+
+  public static final String SECURE_WEBSOCKET_PROTOCOL_STRING = "wss://";
   
   static final String REGEX_SPLIT_CLUSTER_NAME = "^((?:[^/]*/){1}[^/]*)";
   
@@ -181,7 +183,7 @@ public class GatewayWebsocketHandler extends WebSocketHandler
     try {
 
       /* if we do not find websocket URL we default to HTTP */
-      if (!StringUtils.contains(backendURL, WEBSOCKET_PROTOCOL_STRING)) {
+      if (!StringUtils.containsAny(backendURL, WEBSOCKET_PROTOCOL_STRING, SECURE_WEBSOCKET_PROTOCOL_STRING))
{
         URL serviceUrl = new URL(backendURL);
 
         final StringBuffer backend = new StringBuffer();


Mime
View raw message