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

Angular 9 --disableHostCheck flag has no effect when --host is passed (or --configuration) #20951

Closed
ghost opened this issue May 26, 2021 · 2 comments · Fixed by #20952
Closed

Comments

@ghost
Copy link

ghost commented May 26, 2021

Created a new project with Angular CLI 9.1.15 (but also tested with version 11.2.13, no difference at all):

$ npm run start -- --host 0.0.0.0 

> angular-nine-template@0.0.0 start /home/rkrisztian/tmp/angular-nine-template
> ng serve "--host" "0.0.0.0"

WARNING: This is a simple server for use in testing or debugging Angular applications
locally. It hasn't been reviewed for security issues.

Binding this server to an open connection can result in compromising your application or
computer. Using a different host than the one passed to the "--host" flag might result in
websocket connection issues. You might need to use "--disableHostCheck" if that's the
case.
(...)
$ npm run start -- --host 0.0.0.0 --disableHostCheck true 

> angular-nine-template@0.0.0 start /home/rkrisztian/tmp/angular-nine-template
> ng serve "--host" "0.0.0.0" "--disableHostCheck" "true"

WARNING: This is a simple server for use in testing or debugging Angular applications
locally. It hasn't been reviewed for security issues.

Binding this server to an open connection can result in compromising your application or
computer. Using a different host than the one passed to the "--host" flag might result in
websocket connection issues. You might need to use "--disableHostCheck" if that's the
case.
WARNING: Running a server with --disable-host-check is a security risk. See https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a for more information.
(...)

Why does it still warn me?

I can't do anything about it, becuase if I move the host parameter to angular.json, and use --configuration to specify the configuration I want to use, the problem is still back, and --disableHostCheck cannot do anything about it!

Please help, this is really frustrating. Although right now we are on Angular version 9, we do plan to upgrade all the way up to 11 (maybe to 12 later), but it takes time...

@alan-agius4
Copy link
Collaborator

NB: this has no impact on the functionality of the dev-server. The warning is just being shown all the time.

clydin pushed a commit that referenced this issue May 26, 2021
…ng only when not using `disableHostCheck`

Closes #20951
clydin pushed a commit that referenced this issue May 26, 2021
…ng only when not using `disableHostCheck`

Closes #20951

(cherry picked from commit 7ff41e4)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant