-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix(node): listen on 0.0.0.0 if server.host is set to true #10282
Conversation
- Added function to return proper value for host based on options.host's type and value.
- Modified hostOptions to take in host as an input. - Added `server-host` test to test new function.
🦋 Changeset detectedLatest commit: 1ad0754 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The changes look great! There seems to be an extra |
Oh! I realize my mistake now. Apologies! Will fix 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.
Looks great to me! Thanks @kevinzunigacuellar for the clear tests!
Sounds good! This change LGTM! Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
Thanks to @lilnasy for all the guidance. Couldn't have done it without his help. |
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.
Just a tiny comment to reuse some types. Thanks for putting together the PR @SatanshuMishra
Update variable types to use pre-existing types. Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>
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.
LGTM! A little changeset suggestion ;)
Improve wording for changset. Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
* main: (327 commits) [ci] format fix(node): listen on 0.0.0.0 if server.host is set to true (withastro#10282) [ci] format fix(dev): cosider `base` when special-casing `/_image` (withastro#10274) [ci] format update login flow to support Brave (withastro#10258) [ci] format improve link command (withastro#10257) Updates deprecated Node.js 16 github actions (withastro#10270) Fix Vitest check fail again (withastro#10266) [ci] format Adds auto completion of `astro:` events when adding or removing event listeners on `document` (withastro#10263) Update Vite to latest (withastro#10259) [ci] release (withastro#10236) [ci] format fix(i18n): localised index pages are overwritten (withastro#10250) fix: change strategy for route caching (withastro#10248) Fix TypeScript type definitions for `Code` component (withastro#10251) chang changeset (withastro#10253) Removes morph animations when setting transition:animate=none (withastro#10247) ...
Changes
Problem: In Astro's "server" output mode, setting
server.host: true
incorrectly binds the server tolocalhost
, preventing connections from other devices.Cause: The existing code always assigns
localhost
if theoptions.host
value is boolean, regardless of whether it'strue
orfalse
.Proposed Fix: The code now correctly handles both string and boolean values for
options.host
:options.host
is a string, its value is used directly.True
: Binds to0.0.0.0
.False
: Binds tolocalhost
.Testing
A new test was created to ensure this change behaved as expected. All tests were run and passed.
Docs
This change simply fixes a bug. No affect to user's behavior or doc changes are expected.
Thank you to @kevinzunigacuellar & @lilnasy for their contributions to this PR. This PR closes #10264.