Skip to content

Commit c13f971

Browse files
committed
Alternative solution that is forward compatible
1 parent 7606541 commit c13f971

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/handlers/get.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ function handler (req, res, next) {
8383
rootPath: ldp.root,
8484
includeHost: ldp.multiuser
8585
})
86-
contentType = mapper._getContentTypeByExtension(path)
87-
res.setHeader('Content-Type', contentType)
88-
res.status(200).send('OK')
89-
return next()
86+
return mapper.mapFileToUrl({ path }).then(mappedFile => {
87+
contentType = mappedFile.contentType
88+
res.setHeader('Content-Type', contentType)
89+
res.status(200).send('OK')
90+
return next()
91+
})
9092
}
9193

9294
// Handle dataBrowser

0 commit comments

Comments
 (0)