Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rmhaiderali committed Jan 20, 2024
1 parent a420346 commit 9e865b4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,15 +716,13 @@ SendStream.prototype.sendFile = function sendFile (path) {
debug('stat "%s"', path)
fs.stat(path, function onstat (err, stat) {
var pathEndsWithSep = path[path.length - 1] === sep

if (err && err.code === 'ENOENT' && !extname(path) && !pathEndsWithSep) {
// not found, check extensions
return next(err)
}
if (err) return self.onStatError(err)
if (stat.isDirectory()) return self.redirect(path)
if(pathEndsWithSep) return self.error(404)

if (pathEndsWithSep) return self.error(404)
self.emit('file', path, stat)
self.send(path, stat)
})
Expand Down

0 comments on commit 9e865b4

Please sign in to comment.