Android: Fixes #11292: Fix unable to sync with multiple Nextcloud accounts in different profiles (#11674)

pull/11679/head
Henry Heino 2025-01-18 04:35:22 -08:00 committed by GitHub
parent 92abfac3af
commit 76274033db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -378,6 +378,15 @@ class WebDavApi {
if (options.path) fetchOptions.path = options.path;
if (body) fetchOptions.body = body;
fetchOptions.ignoreTlsErrors = this.options_.ignoreTlsErrors();
if (shim.mobilePlatform() === 'android') {
// Using credentials = 'omit' prevents authentication cookies from
// being stored. React Native has issues related to cookie authentication:
// https://github.com/facebook/react-native/issues/23185
//
// Auth tokens are passed through the "Authorization" header, so
// these cookies should not be necessary.
fetchOptions.credentials = 'omit';
}
const url = `${this.baseUrl()}/${ltrimSlashes(path)}`;
if (shim.httpAgent(url)) fetchOptions.agent = shim.httpAgent(url);