diff options
Diffstat (limited to 'apps/files_sharing/js/public.js')
-rw-r--r-- | apps/files_sharing/js/public.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index af808447381..f2d6355d76a 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -155,7 +155,11 @@ OCA.Sharing.PublicApp = { this.fileList.getDownloadUrl = function (filename, dir, isDir) { var path = dir || this.getCurrentDirectory(); if (filename && !_.isArray(filename) && !isDir) { - return OC.getRootPath() + '/public.php/webdav' + OC.joinPaths(path, filename); + var portPart = ''; + if (OC.getPort()) { + portPart = ':' + OC.getPort(); + } + return OC.getProtocol() + '://' + token + '@' + OC.getHost() + portPart + OC.getRootPath() + '/public.php/webdav' + OC.joinPaths(path, filename); } if (_.isArray(filename)) { filename = JSON.stringify(filename); |