Skip to content

Commit 110788c

Browse files
committed
Do not include port number in loopback address check
1 parent a57c910 commit 110788c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function SockJS(url, protocols, options) {
7878
// Step 2 - don't allow secure origin with an insecure protocol
7979
if (loc.protocol === 'https:' && !secure) {
8080
// exception is 127.0.0.0/8 and ::1 urls
81-
if (!urlUtils.isLoopbackAddr(parsedUrl.host)) {
81+
if (!urlUtils.isLoopbackAddr(parsedUrl.hostname)) {
8282
throw new Error('SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS');
8383
}
8484
}

0 commit comments

Comments
 (0)