You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-13 00:10:37 +02:00
Update file-api-driver-webdav.js
This commit is contained in:
@ -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;
|
||||||
|
Reference in New Issue
Block a user