Skip to content

Commit 81d42cd

Browse files
committed
Use ResourceMapper in header#linksHandler
1 parent 3fd3bce commit 81d42cd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/header.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@ function addLinks (res, fileMetadata) {
4141
}
4242
}
4343

44-
function linksHandler (req, res, next) {
44+
async function linksHandler (req, res, next) {
4545
const ldp = req.app.locals.ldp
46-
const root = !ldp.multiuser ? ldp.root : ldp.root + req.hostname + '/'
47-
let filename = utils.uriToFilename(req.url, root)
46+
const { path: filename } = await ldp.resourceMapper.mapUrlToFile(req)
4847

49-
filename = path.join(filename, req.path)
5048
if (path.extname(filename) === ldp.suffixMeta) {
5149
debug.metadata('Trying to access metadata file as regular file.')
5250

0 commit comments

Comments
 (0)