fix NotAuthorized error when serving static files while directory var…#1692
Open
unsol wants to merge 5 commits intorestify:masterfrom
unsol:master
Open
fix NotAuthorized error when serving static files while directory var…#1692unsol wants to merge 5 commits intorestify:masterfrom unsol:master
unsol wants to merge 5 commits intorestify:masterfrom
unsol:master
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. |
Author
|
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. |
Author
|
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
Author
|
Been running on 7.4.0. Doesn't look like 7.5.0 will have any effect on the serveStatic changes. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-Submission Checklist
make prepushIssues
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.