Skip to content

Commit

Permalink
Use secure websocket protocol for secure pages
Browse files Browse the repository at this point in the history
  • Loading branch information
sbeigel committed Mar 24, 2018
1 parent a7b2fcf commit a3a010c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/src/play/mvc/Router.java
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ public static String getFullUrl(String action, Map<String, Object> args) {
ActionDefinition actionDefinition = reverse(action, args);
String base = getBaseUrl();
if (actionDefinition.method.equals("WS")) {
return base.replaceFirst("https?", "ws") + actionDefinition;
return base.replaceFirst("http:", "ws:").replaceFirst("https:", "wss:") + actionDefinition;
}
return base + actionDefinition;
}
Expand Down Expand Up @@ -790,7 +790,7 @@ public void absolute() {
url = (isSecure ? "https://" : "http://") + hostPart + url;
}
if (method.equals("WS")) {
url = url.replaceFirst("https?", "ws");
url = isSecure ? url.replaceFirst("https:", "wss:") : url.replaceFirst("http:", "ws:");
}
}
}
Expand Down

0 comments on commit a3a010c

Please sign in to comment.