Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
  • Loading branch information
rullzer authored and npmbuildbot[bot] committed Aug 27, 2020
commit 07fff69114952c7bee79d85f655978a298523845
40 changes: 31 additions & 9 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.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