diff options
author | Lukas Reschke <lukas@owncloud.com> | 2016-01-07 13:55:32 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2016-01-07 13:55:32 +0100 |
commit | b9e49ae13a78156f3459b80accb9056d2017c59a (patch) | |
tree | d23de0c94d431b3d38cda5a85fe06d468401c8a5 /apps/files_sharing/js/public.js | |
parent | 336fe868b2ee3a4105b93b71a1e739c9e412237b (diff) | |
parent | 9742e9b113ccc16d4644e07eeb651b3ba5fc348b (diff) | |
download | nextcloud-server-b9e49ae13a78156f3459b80accb9056d2017c59a.tar.gz nextcloud-server-b9e49ae13a78156f3459b80accb9056d2017c59a.zip |
Merge pull request #21503 from owncloud/public-fixdownloadlinktoken
Add token in webdav download link of public page
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); |