1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-30 08:26:59 +02:00

Merge branch 'master' of github.com:laurent22/joplin

This commit is contained in:
Laurent Cozic 2018-05-25 13:31:27 +01:00
commit 1841c4dc11
4 changed files with 13 additions and 6 deletions

View File

@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>10.0.22</string>
<string>10.0.24</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>22</string>
<string>24</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>

View File

@ -100,6 +100,8 @@ class DropboxApi {
isTokenError(status, responseText) {
if (status === 401) return true;
if (responseText.indexOf('OAuth 2 access token is malformed') >= 0) return true;
// eg. Error: POST files/create_folder_v2: Error (400): Error in call to API function "files/create_folder_v2": Must provide HTTP header "Authorization" or URL parameter "authorization".
if (responseText.indexOf('Must provide HTTP header "Authorization"') >= 0) return true;
return false;
}
@ -211,4 +213,4 @@ class DropboxApi {
}
module.exports = DropboxApi;
module.exports = DropboxApi;

View File

@ -49,7 +49,7 @@ class SyncTargetDropbox extends BaseSyncTarget {
});
api.on('authRefreshed', (auth) => {
this.logger().info('Saving updated OneDrive auth.');
this.logger().info('Saving updated Dropbox auth.');
Setting.setValue('sync.' + SyncTargetDropbox.id() + '.auth', auth ? auth : null);
});
@ -70,4 +70,4 @@ class SyncTargetDropbox extends BaseSyncTarget {
}
module.exports = SyncTargetDropbox;
module.exports = SyncTargetDropbox;

View File

@ -299,6 +299,11 @@ class FileApiDriverWebDav {
async mkdir(path) {
try {
// RFC wants this, and so does NGINX. Not having the trailing slash means that some
// WebDAV implementations will redirect to a URL with "/". However, when doing so
// in React Native, the auth headers, etc. are lost so we need to avoid this.
// https://github.com/facebook/react-native/issues/929
if (!path.endsWith('/')) path = path + '/';
await this.api().exec('MKCOL', path);
} catch (error) {
if (error.code === 405) return; // 405 means that the collection already exists (Method Not Allowed)
@ -345,4 +350,4 @@ class FileApiDriverWebDav {
}
module.exports = { FileApiDriverWebDav };
module.exports = { FileApiDriverWebDav };