-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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(cli-service): pass --public host to devserver #6066
Conversation
close vuejs#3220 Prevent "Invalid Host" error by passing public host to dev server when --public is used
Done as suggested, However, note that At the same time, So, long story short:
|
Your codes fix this problem, so we can handle
Your codes make CLI behave the same as webpack-dev-server in this respect.
I think it's a very corner case. Moreover, there may be some historical reasons that I don’t know make CLI and webpack-dev-server behave inconsistently |
Ah, you're right of course, somehow totally missed that my code that extracts the host will be run both for Well, guess this PR is ready then? |
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.
Thanks!
close #3220
Prevent "Invalid Host" error by passing public host through to webpack-dev-server when
--public
is usedWhat kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
Other information:
When you use the
public
option in webpack-dev-server it'll automatically allow requests from the specified host, without needing the additionalallowedHosts[]
ordisableHostCheck
options. However when the--public
option in Vue CLI was used, the value was not passed through to webpack-dev-server (as HMR client injection is handled separately) so you still got theInvalid host
error in that case.This PR extracts the host from the
--public
arg and passes it through to the dev server to prevent this error.