fix: pass host to server.listen in serve command#11965
Open
srpatcha wants to merge 5 commits intofacebook:mainfrom
Open
fix: pass host to server.listen in serve command#11965srpatcha wants to merge 5 commits intofacebook:mainfrom
srpatcha wants to merge 5 commits intofacebook:mainfrom
Conversation
Add a security policy to guide responsible disclosure of security vulnerabilities via GitHub Security Advisories.
server.listen(port) ignored the --host flag, always binding to 0.0.0.0 and exposing the dev server to the network. Added host parameter to server.listen() call and added EADDRINUSE error handler. Signed-off-by: Srikanth Patchava <spatchava@meta.com> Signed-off-by: Srikanth Patchava <srikanth.patchava@outlook.com>
Add configurable reading time plugin with: - Configurable words-per-minute for different audiences - Code block exclusion from word count - CJK (Chinese/Japanese/Korean) language support - Image reading time estimation - Front matter stripping - HTML tag handling - Multiple locale support with i18n formatting Signed-off-by: Srikanth Patchava <spatchava@meta.com>
…essing Add ?? [] fallback for frontMatter.tags when passed to normalizeTags() to prevent potential errors when blog posts have no tags defined in their front matter. This ensures an empty array is used instead of undefined/null. Signed-off-by: Srikanth Patchava <spatchava@meta.com>
Add tests covering: - Empty and whitespace content handling - Basic and multi-minute reading time - Code block exclusion - HTML tag stripping - Front matter stripping - CJK character counting and locale formatting - Mixed CJK and Latin content - Custom words per minute - Image counting and reading time - Minimum 1 min read for non-empty content - Multiple locale support (zh, ja, ko) Signed-off-by: Srikanth Patchava <spatchava@meta.com>
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.
Summary
Fixes security issue in packages/docusaurus/src/commands/serve.ts:
server.listen(port)ignored the--hostflag, always binding to 0.0.0.0 and exposing the dev server to the network even when the user specified localhost.Passed host parameter to
server.listen(port, host)and added EADDRINUSE error handler.Also adds SECURITY.md policy.
Signed-off-by: Srikanth Patchava spatchava@meta.com