-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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(server): hostname defaults to localhost, fix #3355 #3383
Merged
Conversation
This file contains 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
9 tasks
Shinigami92
reviewed
May 12, 2021
nihalgonsalves
previously approved these changes
May 12, 2021
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.
I like this structure 👍🏼 It's more understandable now, and there aren't replacements in different places.
Co-authored-by: Nihal Gonsalves <nihal@nihalgonsalves.com>
Co-authored-by: Nihal Gonsalves <nihal@nihalgonsalves.com>
nihalgonsalves
approved these changes
May 12, 2021
Shinigami92
approved these changes
May 12, 2021
antfu
approved these changes
May 12, 2021
fi3ework
pushed a commit
to fi3ework/vite
that referenced
this pull request
May 22, 2021
…3383) Co-authored-by: Nihal Gonsalves <nihal@nihalgonsalves.com>
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.
Description
Rework of #3382, avoiding replacing
'127.0.0.1'
by'localhost'
if this was defined by the user usinghost
It also fixes
options.host === false
.The hint to use
host
in the console is not shown if the user sets127.0.0.1
by hand.Fix #3355
After #2977, we lost the hostname defaulting to localhost for
'127.0.0.1'
and'0.0.0.0'
vite/packages/vite/src/node/server/index.ts
Line 536 in c374a54
This PR adds that logic back, also including
host === undefined
and'::'
that should be treated equally to '0.0.0.0'The reported URL in the console also replaces
'127.0.0.1'
by localhost now.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).--
Replaces + closes #3382