[Pkg-javascript-commits] [sockjs-client] 294/350: Add support for IPv6 literal addresses in the connection URL

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:04:31 UTC 2016


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.

commit 6aec4d553644d775dfc3e5f0cfb759b94ec4e252
Author: Luigi Pinca <luigipinca at gmail.com>
Date:   Tue May 5 10:37:37 2015 +0200

    Add support for IPv6 literal addresses in the connection URL
---
 lib/transport/driver/xhr.js | 2 +-
 tests/lib/test-utils.js     | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/transport/driver/xhr.js b/lib/transport/driver/xhr.js
index c6045b0..440d3c7 100644
--- a/lib/transport/driver/xhr.js
+++ b/lib/transport/driver/xhr.js
@@ -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
diff --git a/tests/lib/test-utils.js b/tests/lib/test-utils.js
index e74d782..3a9d886 100644
--- a/tests/lib/test-utils.js
+++ b/tests/lib/test-utils.js
@@ -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 () {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list