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.
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
http: add
http.createStaticServer
#45096base: main
Are you sure you want to change the base?
http: add
http.createStaticServer
#45096Changes from 1 commit
318610e
77e0416
b1cb361
ac549c4
d3b189f
b6dbf4f
bc6fd54
39dbb48
c53b51e
c394473
6502cbc
9d408e7
9a9caa7
bd9a6bd
a0c7864
20e3d86
98a5563
1259d43
f3d663d
60d3f0b
41fc901
47d2f8b
fa52ee0
968efde
5e018ef
3698f0c
d8ce4b3
0c91db4
7b40455
0bc9f5e
29257f9
a5ea0d7
c1e6869
2e63aba
File filter
Filter by extension
Conversations
Jump to
http.createStaticServer
There are no files selected for viewing
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.
This is dangerous. If someone has their own preload module and happens to
require('http/server')
within it, this part will be run while they may not expect it.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.
You should use
stream.pipeline
instead if this.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.
pipeline
implementation seems overly complicated in comparison of what's needed here (we don't need anyAbortSignal
support, etc.), and tries to do more that we want (i.e. it closes the request in case of error before we can send a 404 status).