diff --git a/lib/ldp.js b/lib/ldp.js index e3c261f6..5b5a729c 100644 --- a/lib/ldp.js +++ b/lib/ldp.js @@ -243,15 +243,11 @@ class LDP { throw error(413, 'User has exceeded their storage quota') } // Set url using folder/.meta. This is Hack to find folder path - if (container) { - if (typeof url !== 'string') { - url.url = url.url + suffixMeta - } else { - url = url + suffixMeta - } - contentType = 'text/turtle' - } - const { path } = await this.resourceMapper.mapUrlToFile({ url, contentType, createIfNotExists: true }) + const { path } = await this.resourceMapper.mapUrlToFile({ + url: container ? (url.url || url) + suffixMeta : url, + contentType, + createIfNotExists: true + }) // 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) }