-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
feat: make allowedHosts accept localhost subdomains by default #4357
feat: make allowedHosts accept localhost subdomains by default #4357
Conversation
Use Case: Some web applications will serve multiple domains and render different content depending on the incoming header. In a development environment, these applications may use localhost subdomains to simulate these alternative domains. To reduce overall configuration, make the webpack-dev-server allow "localhost" as well as its subdomains. As "localhost" is already considered safe and convenient, the same can be said of its subdomains. Available Workaround: Without this feature, developing a multi-domain application requires configuring webpack-dev-server with: allowedHosts: ".localhost"
|
I think it is expected, because it is not standard, localhost is built-in loop, but *.localhost are not |
On Fedora Linux, all subdomains resolve to localhost out of the box:
It is this fact that originally drew me using localhost subdomains as a viable workflow. |
RFC 2606 states and reserves:
So it's unlikely other applications use |
@ylemkimon Yeah, I see, let's merge it |
Codecov Report
@@ Coverage Diff @@
## master #4357 +/- ##
=======================================
Coverage 92.06% 92.06%
=======================================
Files 16 16
Lines 1638 1639 +1
Branches 616 617 +1
=======================================
+ Hits 1508 1509 +1
Misses 119 119
Partials 11 11
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Use Case:
Some web applications will serve multiple domains and render different
content depending on the incoming header. In a development environment,
these applications may use localhost subdomains to simulate these
alternative domains.
To reduce overall configuration, make the webpack-dev-server allow
"localhost" as well as its subdomains. As "localhost" is already
considered safe and convenient, the same can be said of its subdomains.
Available Workaround:
Without this feature, developing a multi-domain application requires
configuring webpack-dev-server with:
For Bugs and Features; did you add new tests?
Yes.
Motivation / Use-Case
Some web applications will serve multiple domains and render different
content depending on the incoming header. In a development environment,
these applications may use localhost subdomains to simulate these
alternative domains.
To reduce overall configuration, make the webpack-dev-server allow
"localhost" as well as its subdomains. As "localhost" is already
considered safe and convenient, the same can be said of its subdomains.
Breaking Changes
No.
Additional Info
Available Workaround:
Without this feature, developing a multi-domain application requires
configuring webpack-dev-server with: