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

Proposal: Add host option to override node fs and path modules #174

Closed
wants to merge 1 commit into from

Conversation

barak007
Copy link

@barak007 barak007 commented Oct 23, 2018

Hi,
I have a use-case that requires me to serve files from memory in my tests.
Currently, I use express.static() from serve-static which uses this package. Now, I want to keep the same API but enable passing an option to override the default host file-system and path resolution.
There is an issue (expressjs/serve-static#83) in express-static that requests the same thing but hasn't seen much activity.

About the tests missing from this pull request.
Since there is no changed behavior, all of the current tests are passing. What I would really want to do is wrap all the existing test-cases in a factory and re-run them using an external host.
Would you have any objections to this test plan? Would love to get this in.

@dougwilson
Copy link
Contributor

Sorry, this is not the correct implementation for all the reasons from the previously closed PRs and issues on this.

Please move the discussion/proposal to #160 . If someone can provide a proposal that addresses these, that would be the way to move forward.

I'm actually working on a security fix currently that would complete rewrite which fs methods are called, even apart from the changes PR #125 makes. This PR would make those types of changes no longer backwards compatible as our exact usage of the internal fs becomes public as folks will end up only passing in the bare minimum to make their use case work.

See past discussion #149 as well.

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

Successfully merging this pull request may close these issues.

2 participants