Skip to content

Commit 59b6f11

Browse files
rullzernpmbuildbot[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 59b6f11

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

js/viewer-main.js

Lines changed: 29 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/viewer-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)