nextcloud-libraries / nextcloud-axios

Simple, typed wrapper of an Axios instance for Nextcloud https://npmjs.org/@nextcloud/axios
https://nextcloud.github.io/nextcloud-axios/
GNU General Public License v3.0
8 stars 5 forks source link

fix: Set X-Requested-With header on all requests to avoid browser auth dialogs #637

Closed juliushaertl closed 10 months ago

juliushaertl commented 10 months ago

Server has logic in place to return a dummyauth response header in case this one is set: https://github.com/nextcloud/server/commit/dfc3536d2b95fea1b54b3e85651e3a66c2d0088e

This helps to handle requests that happen in the web UI after authentication was revoked (e.g. by disabling a user) more gracefully, otherwise a request would lead to the browser showing a basic auth dialog.

Steps to reproduce:

codecov[bot] commented 10 months ago

Codecov Report

Merging #637 (ceb4dc3) into master (27e2158) will not change coverage. The diff coverage is n/a.

@@            Coverage Diff            @@
##            master      #637   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines           40        40           
  Branches         5         5           
=========================================
  Hits            40        40           
Files Changed Coverage Δ
lib/index.ts 100.00% <ø> (ø)