Skip to content
Snippets Groups Projects
Commit 816865b3 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

more substitution fun in test harness. find places where hostname:port is...

more substitution fun in test harness.  find places where hostname:port is explicit without scheme prepended and get those subbed correctly (like in host-meta files)
parent c975b5fd
No related branches found
No related tags found
No related merge requests found
......@@ -34,8 +34,18 @@ 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(0,5) === 'https' ? from.substr(8) : from.substr(7));
data = data.replace(new RegExp(from, 'g'), to.substr(7));
// and explicit cases where port is appended
var fromWithPort;
if (from.substr(0,5) === 'https') {
from = from.substr(8);
fromWithPort = from + ":443";
} else {
from = from.substr(7);
fromWithPort = from + ":80";
}
to = to.substr(7);
data = data.replace(new RegExp(fromWithPort, 'g'), to);
data = data.replace(new RegExp(from, 'g'), to);
}
return data;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment