Skip to content

Commit

Permalink
CODENVY-529: fix terminal uri usage (#1286)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Garagatyi <[email protected]>
  • Loading branch information
Alexander Garagatyi committed May 18, 2016
1 parent 24d560f commit 54db11a
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@ public String getTerminalUrl() {
if (Constants.TERMINAL_REFERENCE.equals(descriptor.getRef())) {
String terminalUrl = descriptor.getUrl();

terminalUrl = terminalUrl.substring(terminalUrl.indexOf(':'), terminalUrl.length());
String uriWithoutProtocol = terminalUrl.substring(terminalUrl.indexOf(':'), terminalUrl.length());
String protocol = Window.Location.getProtocol().equals("https:") ? "wss" : "ws";

boolean isSecureConnection = Window.Location.getProtocol().equals("https:");

return (isSecureConnection ? "wss" : "ws") + terminalUrl + "/pty";
return protocol +
uriWithoutProtocol +
(terminalUrl.endsWith("/") ? "pty" : "/pty");
}
}

Expand Down

0 comments on commit 54db11a

Please sign in to comment.