Update to support when domain not provided will use relative path

This commit is contained in:
Cheng-Han, Wu 2016-04-22 03:33:24 +08:00
parent ff4698caf5
commit 60046200f8
1 changed files with 7 additions and 4 deletions

View File

@ -63,10 +63,13 @@ var dropbox = config.dropbox || false;
var imgur = config.imgur || false;
function getserverurl() {
var url = '';
if (domain) {
var protocol = protocolusessl ? 'https://' : 'http://';
var url = protocol + domain;
url = protocol + domain;
if (urladdport && ((usessl && port != 443) || (!usessl && port != 80)))
url += ':' + port;
}
if (urlpath)
url += '/' + urlpath;
return url;