diff --git a/lib/ldp.js b/lib/ldp.js index 5b5a729c..c1647956 100644 --- a/lib/ldp.js +++ b/lib/ldp.js @@ -242,12 +242,15 @@ class LDP { if (isOverQuota) { throw error(413, 'User has exceeded their storage quota') } - // Set url using folder/.meta. This is Hack to find folder path - const { path } = await this.resourceMapper.mapUrlToFile({ - url: container ? (url.url || url) + suffixMeta : url, + // Set url using folder/.meta + let { path } = await this.resourceMapper.mapUrlToFile({ + url, contentType, - createIfNotExists: true + createIfNotExists: true, + searchIndex: false }) + + if (container) { path += suffixMeta } // debug.handlers(container + ' item ' + (url.url || url) + ' ' + contentType + ' ' + path) // check if file exists, and in that case that it has the same extension if (!container) { await this.checkFileExtension(url, path) } @@ -260,7 +263,6 @@ class LDP { // clearAclCache() } // Directory created, now write the file - if (container) return return withLock(path, () => new Promise((resolve, reject) => { // HACK: the middleware in webid-oidc.js uses body-parser, thus ending the stream of data // for JSON bodies. So, the stream needs to be reset