Skip to content

Commit

Permalink
Fix issue with file in path (#82)
Browse files Browse the repository at this point in the history
* add enotdir check

* forgot triple equals

* Add enotdir check on other places
  • Loading branch information
AxlLind authored and leo committed Jun 19, 2019
1 parent 0bd3eff commit 39253fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ module.exports = async (request, response, config = {}, methods = {}) => {
try {
stats = await handlers.lstat(absolutePath);
} catch (err) {
if (err.code !== 'ENOENT') {
if (err.code !== 'ENOENT' && err.code !== 'ENOTDIR') {
return internalError(absolutePath, response, acceptsJSON, current, handlers, config, err);
}
}
Expand All @@ -599,7 +599,7 @@ module.exports = async (request, response, config = {}, methods = {}) => {
({stats, absolutePath} = related);
}
} catch (err) {
if (err.code !== 'ENOENT') {
if (err.code !== 'ENOENT' && err.code !== 'ENOTDIR') {
return internalError(absolutePath, response, acceptsJSON, current, handlers, config, err);
}
}
Expand All @@ -609,7 +609,7 @@ module.exports = async (request, response, config = {}, methods = {}) => {
try {
stats = await handlers.lstat(absolutePath);
} catch (err) {
if (err.code !== 'ENOENT') {
if (err.code !== 'ENOENT' && err.code !== 'ENOTDIR') {
return internalError(absolutePath, response, acceptsJSON, current, handlers, config, err);
}
}
Expand Down

0 comments on commit 39253fb

Please sign in to comment.