diff options
author | Cheng-Han, Wu | 2016-04-22 03:33:24 +0800 |
---|---|---|
committer | Cheng-Han, Wu | 2016-04-22 03:33:24 +0800 |
commit | 60046200f8254cec9f734ed591ffc1d68f82a7a7 (patch) | |
tree | 86a1e0c100f21a548366b6c5d77978bd4d37f385 | |
parent | ff4698caf5d8d1941255dff6df2ecc3dfd9edde3 (diff) |
Update to support when domain not provided will use relative path
Diffstat (limited to '')
-rw-r--r-- | lib/config.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/config.js b/lib/config.js index 7028f29a..6738d4a8 100644 --- a/lib/config.js +++ b/lib/config.js @@ -63,10 +63,13 @@ var dropbox = config.dropbox || false; var imgur = config.imgur || false; function getserverurl() { - var protocol = protocolusessl ? 'https://' : 'http://'; - var url = protocol + domain; - if (urladdport && ((usessl && port != 443) || (!usessl && port != 80))) - url += ':' + port; + var url = ''; + if (domain) { + var protocol = protocolusessl ? 'https://' : 'http://'; + url = protocol + domain; + if (urladdport && ((usessl && port != 443) || (!usessl && port != 80))) + url += ':' + port; + } if (urlpath) url += '/' + urlpath; return url; |