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

location.procotol include final ":", and 2 line miss it #395

Closed
SenYu opened this Issue Jul 29, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@SenYu

SenYu commented Jul 29, 2017

from MDN:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/protocol

in html, protocol is usually equal to https:, http:, file: and so on.

but I found in https://github.com/sockjs/sockjs-client/blob/master/lib/main.js#L78

if (loc.protocol === 'https' && !secure) {
    throw new Error('SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS');
  }

where the final ":" is missed

@SenYu

This comment has been minimized.

Show comment
Hide comment
@SenYu

SenYu Jul 29, 2017

when you visit a page with https protocol , and try to connect a websocket with http protocol. it just emit a error, and no useful error message.

after debugger, it is caused by above condition.....

SenYu commented Jul 29, 2017

when you visit a page with https protocol , and try to connect a websocket with http protocol. it just emit a error, and no useful error message.

after debugger, it is caused by above condition.....

@brycekahle

This comment has been minimized.

Show comment
Hide comment
@brycekahle

brycekahle Aug 7, 2018

Contributor

Fixed in #396

Contributor

brycekahle commented Aug 7, 2018

Fixed in #396

@brycekahle brycekahle closed this Aug 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment