Permalink
Browse files

Merge pull request #396 from SenYu/fix/http_in_https

(Fix/http in https) location.protocol should include final ":"
  • Loading branch information...
brycekahle committed Dec 6, 2017
2 parents 4d18fd5 + 9567393 commit 436e997549f3937cc16bd5085addb218d43cfb60
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/location.js
  2. +1 −1 lib/main.js
  3. +1 −1 tests/lib/main-node.js
View
@@ -2,7 +2,7 @@
module.exports = global.location || {
origin: 'http://localhost:80'
, protocol: 'http'
, protocol: 'http:'
, host: 'localhost'
, port: 80
, href: 'http://localhost/'
View
@@ -75,7 +75,7 @@ function SockJS(url, protocols, options) {
var secure = parsedUrl.protocol === 'https:';
// Step 2 - don't allow secure origin with an insecure protocol
if (loc.protocol === 'https' && !secure) {
if (loc.protocol === 'https:' && !secure) {
throw new Error('SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS');
}
View
@@ -9,7 +9,7 @@ describe('SockJS', function() {
describe('WebSocket specification step #2', function () {
var main = proxyquire('../../lib/main', { './location': {
protocol: 'https'
protocol: 'https:'
}});
var sjs = proxyquire('../../lib/entry', { './main': main });

0 comments on commit 436e997

Please sign in to comment.