Skip to content

Commit 5174c33

Browse files
committed
ipv6 urls must have brackeets
1 parent 110788c commit 5174c33

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/utils/url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ module.exports = {
4646
}
4747

4848
, isLoopbackAddr: function (addr) {
49-
return /^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^::1$/.test(addr);
49+
return /^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^\[::1\]$/.test(addr);
5050
}
5151
};

tests/lib/main-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('SockJS', function() {
3131

3232
it('should NOT throw SecurityError for ::1 url from a secure page', function () {
3333
expect(function () {
34-
sjs('http://::1');
34+
sjs('http://[::1]');
3535
}).to.not.throwException();
3636
});
3737

0 commit comments

Comments
 (0)