Skip to content

Commit 29f3e08

Browse files
committed
rewrite create container to keep req
1 parent 44dc0bc commit 29f3e08

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/ldp.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,15 @@ class LDP {
242242
if (isOverQuota) {
243243
throw error(413, 'User has exceeded their storage quota')
244244
}
245-
// Set url using folder/.meta. This is Hack to find folder path
246-
const { path } = await this.resourceMapper.mapUrlToFile({
247-
url: container ? (url.url || url) + suffixMeta : url,
245+
// Set url using folder/.meta
246+
let { path } = await this.resourceMapper.mapUrlToFile({
247+
url,
248248
contentType,
249-
createIfNotExists: true
249+
createIfNotExists: true,
250+
searchIndex: false
250251
})
252+
253+
if (container) { path += suffixMeta }
251254
// debug.handlers(container + ' item ' + (url.url || url) + ' ' + contentType + ' ' + path)
252255
// check if file exists, and in that case that it has the same extension
253256
if (!container) { await this.checkFileExtension(url, path) }
@@ -260,7 +263,6 @@ class LDP {
260263
// clearAclCache()
261264
}
262265
// Directory created, now write the file
263-
if (container) return
264266
return withLock(path, () => new Promise((resolve, reject) => {
265267
// HACK: the middleware in webid-oidc.js uses body-parser, thus ending the stream of data
266268
// for JSON bodies. So, the stream needs to be reset

0 commit comments

Comments
 (0)