From a0dc826a5bed8ce839e5baf7573c0f8a9608f671 Mon Sep 17 00:00:00 2001
From: Lloyd Hilaiel <lloyd@hilaiel.com>
Date: Tue, 3 May 2011 08:03:11 -0600
Subject: [PATCH] fix hostname replacement in test harness

---
 run.js | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/run.js b/run.js
index d3b551cda..a95b9e561 100644
--- a/run.js
+++ b/run.js
@@ -34,7 +34,7 @@ function subHostNames(data) {
     data = data.replace(new RegExp(from, 'g'), to);
 
     // now do another replacement to catch bare hostnames sans http(s)
-    from = (from.substr(5) === 'https' ? from.substr(8) : from.substr(7));
+    from = (from.substr(0,5) === 'https' ? from.substr(8) : from.substr(7));
     data = data.replace(new RegExp(from, 'g'), to.substr(7));
   }
   return data;
@@ -120,14 +120,6 @@ function createServer(obj) {
 
 // start up webservers on ephemeral ports for each subdirectory here.
 var dirs = [
-    {
-        name: "https://eyedee.me",
-        path: path.join(__dirname, "authority")
-    },
-    {
-        name: "http://rp.eyedee.me",
-        path: path.join(__dirname, "rp")
-    },
     {
         name: "http://verifier.eyedee.me",
         path: path.join(__dirname, "verifier")
@@ -135,6 +127,14 @@ var dirs = [
     {
         name: "http://primary.eyedee.me",
         path: path.join(__dirname, "primary")
+    },
+    {
+        name: "http://rp.eyedee.me",
+        path: path.join(__dirname, "rp")
+    },
+    {
+        name: "https://eyedee.me",
+        path: path.join(__dirname, "authority")
     }
 ];
 
-- 
GitLab