Skip to content
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: allow localhost as a valid hostname #7092

Merged
merged 3 commits into from Mar 5, 2022
Merged

Conversation

mrkishi
Copy link
Contributor

@mrkishi mrkishi commented Feb 25, 2022

Description

When passing --host localhost, vite will manually override it to 127.0.0.1. This causes issues on systems with ipv6-first addresses for localhost, as node v17 started respecting the system resolver's IP resolution order.

This will leave localhost unchanged so system resolution is respected.

Additional context

See #7075 .


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@Niputi Niputi added the p2-nice-to-have Not breaking anything but nice to have (priority) label Feb 25, 2022
sodatea
sodatea previously approved these changes Feb 28, 2022
patak-dev
patak-dev previously approved these changes Feb 28, 2022
@patak-dev patak-dev added this to the 2.9 milestone Feb 28, 2022
@patak-dev
Copy link
Member

Let's merge this one in the 2.9 beta, which we will kick start in a few days. Thanks for dividing your PR into two steps @mrkishi, we can discuss bigger changes for 3.0 as @sodatea was suggesting.

@patak-dev patak-dev dismissed stale reviews from sodatea and themself via 0894932 March 5, 2022 19:46
@patak-dev patak-dev changed the title fix: allow localhost as a valid hostname (partially fix #7075) fix: allow localhost as a valid hostname Mar 5, 2022
@patak-dev patak-dev merged commit 4194cce into vitejs:main Mar 5, 2022
@mrkishi mrkishi deleted the localhost branch March 6, 2022 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants