-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: return 404 for ENOTDIR #162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. This seems like a valid issue, and a 404 is probably the appropriate response.
However, we can't merge this PR without a new test case, which tests this.
OK, I will try to prepare some tests |
tests should be ok now |
Hmm, I'm afraid that this error is not used on windows, which causes the coverage check to fail. This is complicated to fix, since the test will need to inject a fake error on windows (inside an Lines 1073 to 1078 in ae77ea5
|
check again, should be ok now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clever fix. We are almost there, just a few more details to finish.
Thanks to both of you for working through this— it's a good fix and looks very close to 100% complete as Gil mentioned above. 💎 👍 |
Ping for merge and publish? |
Inert will return error 500 for non-existing files, when part of the path resembles an existing file.
For example if /a/b/c.html is existing file, requesting /a/b/c.html/d will return 500 instead of 404.
ENOTDIR
is listed here https://nodejs.org/api/errors.html#common-system-errors