Skip to content
Snippets Groups Projects
Commit f79fafcf authored by Vincent Petry's avatar Vincent Petry
Browse files

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.
parent 6b836325
No related branches found
No related tags found
No related merge requests found
...@@ -154,9 +154,6 @@ OCA.Sharing.PublicApp = { ...@@ -154,9 +154,6 @@ OCA.Sharing.PublicApp = {
// TODO: move this to a separate PublicFileList class that extends OCA.Files.FileList (+ unit tests) // TODO: move this to a separate PublicFileList class that extends OCA.Files.FileList (+ unit tests)
this.fileList.getDownloadUrl = function (filename, dir, isDir) { this.fileList.getDownloadUrl = function (filename, dir, isDir) {
var path = dir || this.getCurrentDirectory(); 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)) { if (_.isArray(filename)) {
filename = JSON.stringify(filename); filename = JSON.stringify(filename);
} }
......
...@@ -102,12 +102,12 @@ describe('OCA.Sharing.PublicApp tests', function() { ...@@ -102,12 +102,12 @@ describe('OCA.Sharing.PublicApp tests', function() {
it('returns correct download URL for single files', function() { it('returns correct download URL for single files', function() {
expect(fileList.getDownloadUrl('some file.txt')) expect(fileList.getDownloadUrl('some file.txt'))
.toEqual('https://sh4tok@example.com:9876/owncloud/public.php/webdav/subdir/some file.txt'); .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2Fsubdir&files=some%20file.txt');
expect(fileList.getDownloadUrl('some file.txt', '/another path/abc')) expect(fileList.getDownloadUrl('some file.txt', '/anotherpath/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=%2Fanotherpath%2Fabc&files=some%20file.txt');
fileList.changeDirectory('/'); fileList.changeDirectory('/');
expect(fileList.getDownloadUrl('some file.txt')) 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() { it('returns correct download URL for multiple files', function() {
expect(fileList.getDownloadUrl(['a b c.txt', 'd e f.txt'])) expect(fileList.getDownloadUrl(['a b c.txt', 'd e f.txt']))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment