-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
feat: server.fs.deny
support
#5378
Conversation
I think it should be called But I'm rather hesitant about this. Blacklisting seems like a dangerous approach for anything security-related because there's always some file you could forget or overlook. Much safer to go with a whitelist approach, which I think would be solved by #5361 |
#5361 would still be merged, this PR is complementary. Whitelisting is also quite hard for Vite in general, as we would need to not only filter by folder like you do in SvelteKit but also by file type. So something like I think both options need to be available, and then frameworks can decide how to use them. The current defaults look good to me too. |
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.
I think docs
are missing
Nice feature :)
db05b1a
to
fa86b17
Compare
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.
We didn't manage to discuss this one with Evan, but I think it should be safe to include it in the beta release this week as is marked experimental and it is an extension that was already discussed as a possibility in the past.
One detail, we are allowing files that are directly imported by allowed files to be served even if they aren't in an allowed folder. Maybe we should do the same for deny? At this point, I'm leaning towards a hard deny. We could leave the PR as is an only do a soft deny using the module graph if an use case justifies it (that I don't think it would be the case)
Damnd, GitHub notifications redirects me directly to the diff and then I didn't saw tests are failing :D
Description
Support excluding files to be served by Vite.
.env
,.pem
,.crt
will been excluded by default.Additional context
Open for discussion, will do documentation later.
Related:
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).