[Pkg-javascript-commits] [sockjs-client] 140/350: Use proper host for bad port tests

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:03:55 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 c8487d5e944c9de5f3eb215bd712e94fafcd1b32
Author: Bryce Kahle <bkahle at gmail.com>
Date:   Wed Oct 15 13:05:50 2014 -0400

    Use proper host for bad port tests
---
 tests/lib/senders.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/lib/senders.js b/tests/lib/senders.js
index 3443868..3faa432 100644
--- a/tests/lib/senders.js
+++ b/tests/lib/senders.js
@@ -54,9 +54,16 @@ function wrongUrl(Obj, url, statuses) {
 }
 
 function wrongPort (Obj) {
+  var badUrl;
+  if (global.location) {
+    badUrl = global.location.protocol + '//' + global.location.hostname + ':';
+  } else {
+    badUrl = 'http://localhost:';
+  }
+
   var ports = [25, 8999, 65300];
   ports.forEach(function (port) {
-    wrongUrl(Obj, 'http://localhost:' + port + '/wrong_url_indeed.txt', [0]);
+    wrongUrl(Obj, badUrl + port + '/wrong_url_indeed.txt', [0]);
   });
 }
 

-- 
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