From 38f7e9b358fbfddb89d53e0604ba133fd4ec7e95 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Fri, 4 Mar 2022 13:54:46 +0100 Subject: [PATCH] Add X-Requested-With header to all requests oC 10 uses this header to determine whether a request is an ajax request. If we want to get rid of this, we need to make sure it's not used anymore. For example currently it's used to determine whether a PROPFIND on a password protected link should show an auth popup or not. --- changelog/unreleased/bugfix-x-requested-with-header | 5 +++++ src/helperFunctions.js | 1 + 2 files changed, 6 insertions(+) create mode 100644 changelog/unreleased/bugfix-x-requested-with-header diff --git a/changelog/unreleased/bugfix-x-requested-with-header b/changelog/unreleased/bugfix-x-requested-with-header new file mode 100644 index 000000000..9cce6330b --- /dev/null +++ b/changelog/unreleased/bugfix-x-requested-with-header @@ -0,0 +1,5 @@ +Bugfix: Always add X-Requested-With header + +We've added the `X-Requested-With` header to all requests as oC 10 is using this to determine whether it should treat certain requests as ajax requests or not (for example: ajax requests should never show an auth popup). + +https://github.com/owncloud/owncloud-sdk/pull/1020 diff --git a/src/helperFunctions.js b/src/helperFunctions.js index 2c2730866..d81eb4095 100644 --- a/src/helperFunctions.js +++ b/src/helperFunctions.js @@ -196,6 +196,7 @@ class helpers { headers.Authorization = this._authHeader } headers['X-Request-ID'] = uuidv4() + headers['X-Requested-With'] = 'XMLHttpRequest' return headers }