Skip to content

Commit 342b08d

Browse files
Merge pull request #582 from nextcloud/backport/581/stable19
[stable19] Set the X-Requested-With header on dav requests
2 parents 9d32440 + 59b6f11 commit 342b08d

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)