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

[Bug] "Invalid Host Header" using ng serve --host 0.0.0.0 #582

Closed
mcstepp opened this issue May 11, 2017 · 9 comments
Closed

[Bug] "Invalid Host Header" using ng serve --host 0.0.0.0 #582

mcstepp opened this issue May 11, 2017 · 9 comments

Comments

@mcstepp
Copy link
Contributor

mcstepp commented May 11, 2017

Do you want to request a feature or report a bug?

Bug (cascaded from angular-cli 1.0.1 [webpack-dev-server])

Bug Report

See here: webpack/webpack-dev-server#882

Due to a security fix in webpack, running Covalent source app via proxy results in "Invalid Host Header" printed in the browser. This affects angular-cli 1.0.1

What is the expected behavior?

Covalent source app runs normally.

What is the motivation / use case for changing the behavior?

Working on the Covalent source app for IE11 support using a windows VM for IE11/Edge. I deploy the app on my Mac using ng serve --host 0.0.0.0 to expose it the VM.

Which version of Angular and Material, and which browser and OS does this issue affect?

Affects angular-cli 1.0.1 (See here: angular/angular-cli#6070)

Did this work in previous versions of Angular / Material?

Works in angular-cli 1.0.0

Other information

Rolling back the angular-cli version to previous version restores functionality
ng serve --host 0.0.0.0
I can put in a PR for this breaking dependency.

@emoralesb05
Copy link
Contributor

While i do see the importance of this, i dont want to limit the covalent @angular/cli version to 1.0.0 just because of this, since we want to keep using the latest if possible.

Lets see if they fix it upstream for now, and come back to this if needed.

@ryanper
Copy link

ryanper commented May 16, 2017

I get this error with angular-cli 1.0.2, I understand that --host 0.0.0.0 is no longer allowed and should specify the host-ip-address instead.

@emoralesb05
Copy link
Contributor

Yeah, and this should be addressed with this angular/angular-cli#6173

Which is available if you upgrade to https://github.com/angular/angular-cli/blob/master/CHANGELOG.md#110-beta1-2017-05-09

@mcstepp
Copy link
Contributor Author

mcstepp commented May 17, 2017

Yeah, my issue is particularly that I use a VM and my local machine at the same time (so I can verify no breaking changes across browsers) and would prefer not to have to serve on localhost, and then serve to the proxy ip which isn't accessible from my local machine. Does this mean with the latest upgrade, I can still serve to 0.0.0.0 to keep my proxy and localhost if I use the disable-host-check flag?

@emoralesb05
Copy link
Contributor

Yeah, the latest 1.1.0-beta.1 has that flag. Supposed to be for that specific case.

@mcstepp
Copy link
Contributor Author

mcstepp commented May 17, 2017

Great! Works for me. I'll close this bug report then.

@mcstepp mcstepp closed this as completed May 17, 2017
@devyani22
Copy link

I have Angular cli 1.2.6. --host is not working, neither does this have disable-host-check flag. Does that mean that I have to go back to 1.1.0-beta.1?

@emoralesb05
Copy link
Contributor

That would probably be a question for the angular CLI team

@kyleledbetter
Copy link
Contributor

btw workaround for this is running:

ng serve --host 0.0.0.0 --disable-host-check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants