1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Update file-api-driver-webdav.js

This commit is contained in:
bradmcl 2018-05-26 21:06:51 -04:00 committed by GitHub
parent 8dc14516d6
commit 281e36fde7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,8 +43,8 @@ class FileApiDriverWebDav {
const propStat = this.api().arrayFromJson(resource, ['d:propstat']);
if (!Array.isArray(propStat)) throw new Error('Invalid WebDAV resource format: ' + JSON.stringify(resource));
const httpStatusCode = parseInt(propStat[0]['d:status'][0].split(' ')[1]); // Parsing "HTTP/1.1 200 OK"
if ( httpStatusCode === 404 ) throw new JoplinError(resource, 404);
const httpStatusLine = this.api().stringFromJson(resource, ['d:propstat',0,'d:status', 0]);
if ( typeof httpStatusLine === 'string' && httpStatusLine.split(' ')[1] === '404' ) throw new JoplinError(resource, 404);
const resourceTypes = this.api().resourcePropByName(resource, 'array', 'd:resourcetype');
let isDir = false;