-
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
"Invalid Host Header" in JS console since upgrading to Webpacker 2.0 #424
Comments
Are you hitting localhost for development, or a hostname that aliases to it? I ask because I use an alias (local.mydomain) to hit my localhost and I started getting Invalid Host Header during my testing of webpacker today. This seems to be a change due to a decently sized security risk: https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a I think a patch like the above that exposes In the meantime, if you run webpack-dev-server on a non-'localhost' domain name that hits localhost, |
Interesting. In my case I'm using straight up localhost. I mean my rails app runs on pow, but I don't think that has any effect. |
Yeah, that's kind of what I was trying to say. I'm not experienced with pow, but if you hit foo.dev for your localhost rails server, that'd fit my definition of an alias. I forget the technical term. I just add my aliases to |
Oh, I mean rails app is aliased, but webpack-dev-server runs on localhost:8080. I thought you were saying your webpack-dev-server was aliased. |
Update: Instead of the above fix, I changed the dev server host in |
Fixed in #431 |
I just wanted to add to this issue as I had this same problem and googled it and found this issue. For me the problem was that another webpack-dev-server from another project was running on the same port and for whatever reason this caused the "Invalid host" error to appear. Hope that might help someone else. |
Could also be that you're trying to load your website at a host not defined in |
Works for me,
|
Since upgrading to webpacker 2.0, I'm getting a bunch of "invalid host header" errors in the JS console. Other sources online have said to pass
disableHostCheck true
when starting webpack-dev-server. I've modified my webpacker.yml to look like this:And then development.js, I've modified the devServer object to include this line:
disableHostCheck: settings.dev_server.disableHostCheck,
Is that appropriate? Is anyone else getting these errors?
The text was updated successfully, but these errors were encountered: