Skip to content

Commit

Permalink
Add support for IPv6 literal addresses in the connection URL
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed May 5, 2015
1 parent d9cd4f4 commit 6aec4d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/transport/driver/xhr.js
Expand Up @@ -19,7 +19,7 @@ function XhrDriver(method, url, payload, opts) {
var parsedUrl = new URL(url);
var options = {
method: method
, hostname: parsedUrl.hostname
, hostname: parsedUrl.hostname.replace(/\[|\]/g, '')
, port: parsedUrl.port
, path: parsedUrl.pathname + (parsedUrl.query || '')
, headers: opts && opts.headers
Expand Down
4 changes: 3 additions & 1 deletion tests/lib/test-utils.js
Expand Up @@ -13,7 +13,9 @@ module.exports = {
if (global.location) {
return urlUtils.getOrigin(global.location.href);
}
return 'http://localhost:8081';
return /^v0\.(?:8|10)/.test(process.version)
? 'http://localhost:8081'
: 'http://[::1]:8081';
}

, getCrossOriginUrl: function () {
Expand Down

0 comments on commit 6aec4d5

Please sign in to comment.