-
Notifications
You must be signed in to change notification settings - Fork 982
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 NotAuthorized error when serving static files while directory var… #1692
base: master
Are you sure you want to change the base?
Conversation
…iable is set to './
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bad stale bot! Bad! Has anyone had a chance to test this out? I've been using this patch in production since August, and have had no issues. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bumping it up again. Still no issues with daily use. |
fix: emit after event with proper error param for node versions >= 11…
merge 7.5.0
Been running on 7.4.0. Doesn't look like 7.5.0 will have any effect on the serveStatic changes. |
Pre-Submission Checklist
make prepush
Issues
Closes:
Changes
This is to resolve issue #549, so I did not create a new issue for this pull request.
The serveStatic function sets the appendRequestPath option to true by default. This works the majority of the time, but if the directory option is set to "./", then the regex test (
node-restify/lib/plugins/static.js
Line 194 in e663699
The "p", and "re" variables are not used anywhere else in this file -- only within the serve function.
I tested this solution with the following routes:
My folder structure for the tests was something along the lines of:
/
docs/
v1/
index.html
v2/
index.html
app/
firsttest.html
secondtest().html
(contains source code)
dist/
contains typescript build output
I had the first/second test routes set to serve files from the ./app directory, as they just didn't want to serve from docs (kept getting a not found event). I'm assuming that has something to do with the wild card route taking precedence for some reason.