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

[atmosphere.js] Problem with JSESSIONID and GlassFish #351

Closed
jfarcand opened this issue May 9, 2012 · 3 comments
Closed

[atmosphere.js] Problem with JSESSIONID and GlassFish #351

jfarcand opened this issue May 9, 2012 · 3 comments

Comments

@jfarcand
Copy link
Member

jfarcand commented May 9, 2012

See

  http://groups.google.com/group/atmosphere-framework/browse_thread/thread/306b17d43fafd071
jfarcand added a commit that referenced this issue May 9, 2012
@jfarcand
Copy link
Member Author

jfarcand commented May 9, 2012

Integrated

@jfarcand jfarcand closed this as completed May 9, 2012
jfarcand added a commit that referenced this issue May 9, 2012
@flowersinthesand
Copy link
Member

I got it! Here is my fix.

function _buildWebSocketUrl() {
    var url = _request.url;
    url = _attachHeaders();
    return decodeURI($('<a href="' + url + '"/>')[0].href.replace(/^http/, "ws"));
}

4th line converts any url into absolute url whose scheme is ws or wss using DOM api, and it's actually used in jquery-socket's websocket transport - https://github.com/flowersinthesand/jquery-socket/blob/master/jquery.socket.js#L680 You don't need even parseUri function.

Otherwise, at least you should check protocol is valid instead of checking ://, because the scheme separator is only :, and // is optional.

var url = "/what-is-://", urlHasScheme =  /^[\w\+\.\-]+:/.test(url);

@jfarcand
Copy link
Member Author

Many thanks for that!! I've integrated your fix. Thanks!!!

jfarcand added a commit that referenced this issue May 30, 2012
jfarcand added a commit that referenced this issue May 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants