aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-03-31 14:56:11 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-04-06 14:49:32 +0200
commita66cae02efcc27d962d867ba9a9e5da0441333e5 (patch)
tree1961e4bef2fe10626088bff18fe8460d146d18df /apps/files_versions
parentc7c9ee1ebdd07fdd5cf295835d5cf5e061fc40af (diff)
downloadnextcloud-server-a66cae02efcc27d962d867ba9a9e5da0441333e5.tar.gz
nextcloud-server-a66cae02efcc27d962d867ba9a9e5da0441333e5.zip
fix(deps): update webdav 5 usage
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/src/utils/davClient.js17
-rw-r--r--apps/files_versions/src/views/VersionTab.vue1
2 files changed, 11 insertions, 7 deletions
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 <http://www.gnu.org/licenses/>.
*/
-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() {