Skip to content

fix: pass host to server.listen in serve command#11965

Open
srpatcha wants to merge 5 commits intofacebook:mainfrom
srpatcha:chore/add-security-policy
Open

fix: pass host to server.listen in serve command#11965
srpatcha wants to merge 5 commits intofacebook:mainfrom
srpatcha:chore/add-security-policy

Conversation

@srpatcha
Copy link
Copy Markdown

Summary

Fixes security issue in packages/docusaurus/src/commands/serve.ts:

server.listen(port) ignored the --host flag, 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

srpatcha and others added 2 commits April 24, 2026 19:41
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>
@meta-cla meta-cla Bot added the CLA Signed Signed Facebook CLA label Apr 25, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant