aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-02-10 19:09:52 +0100
committerVincent Petry <pvince81@owncloud.com>2016-02-10 19:09:52 +0100
commitf79fafcf0625afdf16aad14b5584b8bad95ae1c8 (patch)
tree36ccea6df8e97f9978daf48699d86c57678a5ff1
parent6b836325cf8b8087a0734574ce4d5d1f8ec8456d (diff)
downloadnextcloud-server-f79fafcf0625afdf16aad14b5584b8bad95ae1c8.tar.gz
nextcloud-server-f79fafcf0625afdf16aad14b5584b8bad95ae1c8.zip
Revert back to non-webdav download link for public URLs
Fixes issues with browsers not happy with the token. Fixes activities which were not sent.
-rw-r--r--apps/files_sharing/js/public.js3
-rw-r--r--apps/files_sharing/tests/js/publicAppSpec.js8
2 files changed, 4 insertions, 7 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index bc609f04f79..da83044714e 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -154,9 +154,6 @@ OCA.Sharing.PublicApp = {
// TODO: move this to a separate PublicFileList class that extends OCA.Files.FileList (+ unit tests)
this.fileList.getDownloadUrl = function (filename, dir, isDir) {
var path = dir || this.getCurrentDirectory();
- if (filename && !_.isArray(filename) && !isDir) {
- return OC.getProtocol() + '://' + token + '@' + OC.getHost() + OC.getRootPath() + '/public.php/webdav' + OC.joinPaths(path, filename);
- }
if (_.isArray(filename)) {
filename = JSON.stringify(filename);
}
diff --git a/apps/files_sharing/tests/js/publicAppSpec.js b/apps/files_sharing/tests/js/publicAppSpec.js
index 8561836d77c..58565744882 100644
--- a/apps/files_sharing/tests/js/publicAppSpec.js
+++ b/apps/files_sharing/tests/js/publicAppSpec.js
@@ -102,12 +102,12 @@ describe('OCA.Sharing.PublicApp tests', function() {
it('returns correct download URL for single files', function() {
expect(fileList.getDownloadUrl('some file.txt'))
- .toEqual('https://sh4tok@example.com:9876/owncloud/public.php/webdav/subdir/some file.txt');
- expect(fileList.getDownloadUrl('some file.txt', '/another path/abc'))
- .toEqual('https://sh4tok@example.com:9876/owncloud/public.php/webdav/another path/abc/some file.txt');
+ .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fsubdir&files=some%20file.txt');
+ expect(fileList.getDownloadUrl('some file.txt', '/anotherpath/abc'))
+ .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fanotherpath%2Fabc&files=some%20file.txt');
fileList.changeDirectory('/');
expect(fileList.getDownloadUrl('some file.txt'))
- .toEqual('https://sh4tok@example.com:9876/owncloud/public.php/webdav/some file.txt');
+ .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2F&files=some%20file.txt');
});
it('returns correct download URL for multiple files', function() {
expect(fileList.getDownloadUrl(['a b c.txt', 'd e f.txt']))