question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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: https://github.com/webpack/webpack-dev-server/issues/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: https://github.com/angular/angular-cli/issues/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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

50reactions
kyleledbettercommented, Aug 24, 2017

btw workaround for this is running:

ng serve --host 0.0.0.0 --disable-host-check
2reactions
emoralesb05commented, May 17, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Invalid Host header" when running Angular/cli development ...
This is a major security issue: some malicious code can request your development server on your behalf and get the response. The problem...
Read more >
What is this “Invalid Host Header” error? | by Avinash Thakur
This error is most commonly caused by a misconfiguration of the application server that causes it to reject non-local connections.
Read more >
[Solved]-Fix "invalid host header" in Angular-angular.js
ng (Angular) => Kill the server and restart it, adding --host 0.0.0.0 --disableHostCheck true. to the command. ; Angular2 => Same as above,...
Read more >
ng serve --public-host
In the course of testing an application hosted on your local machine, you may receive an “Invalid Host Header” error message when testing...
Read more >
docksal/community-support - Gitter
Hmmm. It compiles now but gets Invalid Host header in the browser. ... I would search more for ng serve and Angular app...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found