diff options
Diffstat (limited to 'apps/comments/src/services/DavClient.js')
-rw-r--r-- | apps/comments/src/services/DavClient.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/apps/comments/src/services/DavClient.js b/apps/comments/src/services/DavClient.js index 6837ce90c56..5c2fc96e4db 100644 --- a/apps/comments/src/services/DavClient.js +++ b/apps/comments/src/services/DavClient.js @@ -20,19 +20,18 @@ * */ -import { createClient, getPatcher } from 'webdav' -import axios from '@nextcloud/axios' - +import { createClient } from 'webdav' import { getRootPath } from '../utils/davUtils.js' - -// Add this so the server knows it is an request from the browser -axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest' - -// force our axios -const patcher = getPatcher() -patcher.patch('request', axios) +import { getRequestToken } from '@nextcloud/auth' // init webdav client -const client = createClient(getRootPath()) +const client = createClient(getRootPath(), { + headers: { + // Add this so the server knows it is an request from the browser + 'X-Requested-With': 'XMLHttpRequest', + // Inject user auth + requesttoken: getRequestToken() ?? '', + }, +}) export default client |