added the ability to set a host's host to false, causing the urls it creates to be relative

This commit is contained in:
Spencer Alger
2014-01-16 14:19:11 -07:00
parent eda56aa5d0
commit ab033e9698
2 changed files with 15 additions and 1 deletions

View File

@ -135,7 +135,11 @@ Host.prototype.makeUrl = function (params) {
auth = this.auth + '@';
}
return this.protocol + '://' + auth + this.host + port + path + (query ? '?' + query : '');
if (this.host) {
return this.protocol + '://' + auth + this.host + port + path + (query ? '?' + query : '');
} else {
return path + (query ? '?' + query : '');
}
};
Host.prototype.toString = function () {