From 42091cecf9f96d8aa3fc5c2b5bda9156bae459b5 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 23 Nov 2015 16:17:54 +0100 Subject: Fix public link getDownloadUrl to return Webdav public link This is for apps that use getDownloadUrl() to access the Webdav endpoint for example for streaming. Also happens when clicking on the download action of a file. Note that the regular visible download URL is still the same. --- apps/files_sharing/tests/js/publicAppSpec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/files_sharing/tests') diff --git a/apps/files_sharing/tests/js/publicAppSpec.js b/apps/files_sharing/tests/js/publicAppSpec.js index 1ea5f7ed1bc..74f008025e1 100644 --- a/apps/files_sharing/tests/js/publicAppSpec.js +++ b/apps/files_sharing/tests/js/publicAppSpec.js @@ -101,12 +101,12 @@ describe('OCA.Sharing.PublicApp tests', function() { it('returns correct download URL for single files', function() { expect(fileList.getDownloadUrl('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'); + .toEqual('/owncloud/public.php/webdav/subdir/some file.txt'); + expect(fileList.getDownloadUrl('some file.txt', '/another path/abc')) + .toEqual('/owncloud/public.php/webdav/another path/abc/some file.txt'); fileList.changeDirectory('/'); expect(fileList.getDownloadUrl('some file.txt')) - .toEqual(OC.webroot + '/index.php/s/sh4tok/download?path=%2F&files=some%20file.txt'); + .toEqual('/owncloud/public.php/webdav/some file.txt'); }); it('returns correct download URL for multiple files', function() { expect(fileList.getDownloadUrl(['a b c.txt', 'd e f.txt'])) -- cgit v1.2.3