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; var imgur = config.imgur || false;
function getserverurl() { function getserverurl() {
var protocol = protocolusessl ? 'https://' : 'http://'; var url = '';
var url = protocol + domain; if (domain) {
if (urladdport && ((usessl && port != 443) || (!usessl && port != 80))) var protocol = protocolusessl ? 'https://' : 'http://';
url += ':' + port; url = protocol + domain;
if (urladdport && ((usessl && port != 443) || (!usessl && port != 80)))
url += ':' + port;
}
if (urlpath) if (urlpath)
url += '/' + urlpath; url += '/' + urlpath;
return url; return url;