Skip to content

Commit f68e728

Browse files
author
一杉
committed
fix(protocol should include final ":"): #395
1 parent a1028ed commit f68e728

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/location.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module.exports = global.location || {
44
origin: 'http://localhost:80'
5-
, protocol: 'http'
5+
, protocol: 'http:'
66
, host: 'localhost'
77
, port: 80
88
, href: 'http://localhost/'

lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function SockJS(url, protocols, options) {
7575

7676
var secure = parsedUrl.protocol === 'https:';
7777
// Step 2 - don't allow secure origin with an insecure protocol
78-
if (loc.protocol === 'https' && !secure) {
78+
if (loc.protocol === 'https:' && !secure) {
7979
throw new Error('SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS');
8080
}
8181

0 commit comments

Comments
 (0)