Skip to content
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

Respond with 404 for forbidden assets #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sevab
Copy link

@sevab sevab commented Apr 21, 2017

There are a number of internal files in the dist directory that are currently publicly exposed by the fastboot server (e.g. dist/package.json, dist/node_modules/*, etc).

Don't think there are any security concerns with these files being exposed, just not the expected behavior of the server and not particularly elegant.

This commit returns a 404 when a client requests any of the forbidden assets.

@@ -17,6 +17,12 @@ class ExpressHTTPServer {
this.gzip = options.gzip || false;
this.beforeMiddleware = options.beforeMiddleware || noop;
this.afterMiddleware = options.afterMiddleware || noop;
this.forbiddenAssets = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be useful to have options.forbiddenAssets here as well to allow customization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants