Skip to content

Commit

Permalink
Set the X-Requested-With header on dav requests
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
  • Loading branch information
skjnldsv authored and npmbuildbot[bot] committed Aug 31, 2020
1 parent e0c5405 commit c17c013
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
34 changes: 28 additions & 6 deletions js/viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/services/DavClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import webdav from 'webdav'
import axios from '@nextcloud/axios'
import { getRootPath, getToken, isPublic } from '../utils/davUtils'

// Add this so the server knows it is an request from the browserg
axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest'

// force our axios
const patcher = webdav.getPatcher()
patcher.patch('request', axios)
Expand Down

0 comments on commit c17c013

Please sign in to comment.