From a66cae02efcc27d962d867ba9a9e5da0441333e5 Mon Sep 17 00:00:00 2001 From: John Molakvoæ Date: Fri, 31 Mar 2023 14:56:11 +0200 Subject: fix(deps): update webdav 5 usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- apps/files_versions/src/utils/davClient.js | 17 ++++++++++------- apps/files_versions/src/views/VersionTab.vue | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'apps/files_versions') diff --git a/apps/files_versions/src/utils/davClient.js b/apps/files_versions/src/utils/davClient.js index e4bfeb10411..022d34bbba4 100644 --- a/apps/files_versions/src/utils/davClient.js +++ b/apps/files_versions/src/utils/davClient.js @@ -19,16 +19,19 @@ * along with this program. If not, see . */ -import { createClient, getPatcher } from 'webdav' +import { createClient } from 'webdav' import { generateRemoteUrl } from '@nextcloud/router' -import axios from '@nextcloud/axios' +import { getRequestToken } from '@nextcloud/auth' const rootPath = 'dav' -// force our axios -const patcher = getPatcher() -patcher.patch('request', axios) - // init webdav client on default dav endpoint const remote = generateRemoteUrl(rootPath) -export default createClient(remote) +export default createClient(remote, { + headers: { + // Add this so the server knows it is an request from the browser + 'X-Requested-With': 'XMLHttpRequest', + // Inject user auth + requesttoken: getRequestToken() ?? '', + }, +}) diff --git a/apps/files_versions/src/views/VersionTab.vue b/apps/files_versions/src/views/VersionTab.vue index f2e9576abd0..04b6ecf1add 100644 --- a/apps/files_versions/src/views/VersionTab.vue +++ b/apps/files_versions/src/views/VersionTab.vue @@ -68,6 +68,7 @@ export default { /** * Return the mtime of the first version to display "Initial version" label + * * @return {number} */ initialVersionMtime() { -- cgit v1.2.3