Skip to content

Commit 66c7726

Browse files
rullzerbackportbot[bot]
authored andcommitted
Set the X-Requested-With header on dav requests
This will make sure the server knows it is a webserver request. Hence we can also use this when federation is disabled. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
1 parent 9d32440 commit 66c7726

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/services/DavClient.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ import webdav from 'webdav'
2424
import axios from '@nextcloud/axios'
2525
import { getRootPath, getToken, isPublic } from '../utils/davUtils'
2626

27+
// Add this so the server knows it is an request from the browserg
28+
axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest'
29+
2730
// force our axios
2831
const patcher = webdav.getPatcher()
2932
patcher.patch('request', axios)

0 commit comments

Comments
 (0)