1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-27 23:28:38 +02:00
This commit is contained in:
Laurent Cozic
2020-10-16 16:14:39 +01:00
parent e3a37ec2d6
commit 4e303be85f
24 changed files with 55 additions and 3319 deletions

View File

@ -337,16 +337,16 @@ class WebDavApi {
async exec(method, path = '', body = null, headers = null, options = null) {
headers = Object.assign({}, headers);
options = Object.assign({}, options);
if (!options.responseFormat) options.responseFormat = 'json';
if (!options.target) options.target = 'string';
const authToken = this.authToken();
if (authToken) headers['Authorization'] = `Basic ${authToken}`;
// That should not be needed, but it is required for React Native 0.63+
// https://github.com/facebook/react-native/issues/30176
// https://github.com/facebook/react-native/issues/30176
if (!headers['Content-Type']) {
if (method === 'PROPFIND') headers['Content-Type'] = 'text/xml';
if (method === 'PUT') headers['Content-Type'] = 'text/plain';