diff --git a/server.js b/server.js index a0c1c61d..28bf586a 100755 --- a/server.js +++ b/server.js @@ -174,7 +174,6 @@ function start(configName, options, callback) { }); } -function replaceDomain(uri, domain) { - var parsed = url.parse(uri); - return url.format(parsed); -} +function replaceDomain(url, domain) { + return url.replace(/[^./]+\.[^./]+$/, domain).replace(/[^./]+\.[^.]+\//, domain + "/"); +} \ No newline at end of file