Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1237 Use secure websocket protocol for secure pages #1226

Merged
merged 1 commit into from
May 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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