Skip to content

Commit

Permalink
rewrite create container to keep req
Browse files Browse the repository at this point in the history
  • Loading branch information
bourgeoa committed Nov 4, 2024
1 parent 44dc0bc commit 29f3e08
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/ldp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand All @@ -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
Expand Down

0 comments on commit 29f3e08

Please sign in to comment.