Skip to content

Commit

Permalink
Fixes #1612
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarcand committed May 28, 2014
1 parent ee78cd5 commit 23bf753
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,18 @@ public void onOpen(Session session, EndpointConfig endpointConfig) {
}

try {
String requestUri = session.getRequestURI().toASCIIString();
String requestUri = uri.toASCIIString();
if (requestUri.contains("?")) {
requestUri = requestUri.substring(0, requestUri.indexOf("?"));
}

// https://issues.apache.org/bugzilla/show_bug.cgi?id=56573
// https://java.net/jira/browse/WEBSOCKET_SPEC-228
if (!requestUri.startsWith("ws://")) {
String protocol = session.isSecure() ? "wss://" : "ws://";
requestUri = new StringBuilder(protocol).append("127.0.0.1:8080").append(requestUri).toString();
}

request = new AtmosphereRequest.Builder()
.requestURI(requestUri)
.requestURL(requestUri)
Expand Down

0 comments on commit 23bf753

Please sign in to comment.