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:
parent
8dc14516d6
commit
281e36fde7
@ -43,8 +43,8 @@ class FileApiDriverWebDav {
|
|||||||
const propStat = this.api().arrayFromJson(resource, ['d:propstat']);
|
const propStat = this.api().arrayFromJson(resource, ['d:propstat']);
|
||||||
if (!Array.isArray(propStat)) throw new Error('Invalid WebDAV resource format: ' + JSON.stringify(resource));
|
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"
|
const httpStatusLine = this.api().stringFromJson(resource, ['d:propstat',0,'d:status', 0]);
|
||||||
if ( httpStatusCode === 404 ) throw new JoplinError(resource, 404);
|
if ( typeof httpStatusLine === 'string' && httpStatusLine.split(' ')[1] === '404' ) throw new JoplinError(resource, 404);
|
||||||
|
|
||||||
const resourceTypes = this.api().resourcePropByName(resource, 'array', 'd:resourcetype');
|
const resourceTypes = this.api().resourcePropByName(resource, 'array', 'd:resourcetype');
|
||||||
let isDir = false;
|
let isDir = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user