Skip to content

Commit

Permalink
fix: Do Not Overwrite req.url on Container PUT
Browse files Browse the repository at this point in the history
`req.url` is not overwritten anymore when PUT is used to create a container. This allows subsequent middlewares to have access to the original request URL.
  • Loading branch information
CxRes committed Oct 23, 2024
1 parent 33997ae commit 1f6c16f
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/ldp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down

0 comments on commit 1f6c16f

Please sign in to comment.