-
Notifications
You must be signed in to change notification settings - Fork 12k
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(@angular/cli): add host check flags to ng serve #6173
Conversation
/cc @SanderElias @clydin |
@@ -20,7 +20,8 @@ export interface ServeTaskOptions extends BuildOptions { | |||
host?: string; | |||
proxyConfig?: string; | |||
liveReload?: boolean; | |||
liveReloadClient?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't removing that a breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still there, as an alias for --public-host
. So nothing changes for users of that flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@filipesilva I would like to rename --public-host
to --public-ident
. It's confusing to have 2 host options, and In my opinion, an identifier is more close to what the thing actually does. Hope this is not too late for that ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The option is setting the publicly accessible address of the host and is checked against the host header of all incoming requests. It's also the name used within webpack-dev-server.
c1232a4
to
03002ef
Compare
2970c48
to
759a023
Compare
docs/documentation/serve.md
Outdated
<p> | ||
<code>--live-reload-client</code> | ||
<code>--public</code> (aliases: <code>--live-reload-client</code>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--public-host
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
tests/e2e/tests/misc/public-host.ts
Outdated
.then(() => ngServe('--host=0.0.0.0', `--public-host=${publicHost}`)) | ||
.then(() => request(localAddress)) | ||
.then(body => { | ||
if (!body.match(/<app-root>Loading...<\/app-root>/)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loading will not be there anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Two new flags are added to `ng serve`: - `--public-host` (aliased by `--live-reload-client): Specify the URL that the browser client will use. - `--disable-host-check`: Don't verify connected clients are part of allowed hosts. Setting `--disable-host-check` will output a warning: ``` 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. ``` See angular#6070 for more context about this change. Fix angular#6070
759a023
to
87b450a
Compare
…baseUrl for protractor (angular#6266) angular#6173 added two new settings to the serve task. The --publicHost setting is not respected as baseUrl for protractor in the e2e-task. With this fix, if --publicHost is set, it will be used as baseUrl for protrator.
…baseUrl for protractor (angular#6266) angular#6173 added two new settings to the serve task. The --publicHost setting is not respected as baseUrl for protractor in the e2e-task. With this fix, if --publicHost is set, it will be used as baseUrl for protrator.
…baseUrl for protractor (angular#6266) angular#6173 added two new settings to the serve task. The --publicHost setting is not respected as baseUrl for protractor in the e2e-task. With this fix, if --publicHost is set, it will be used as baseUrl for protrator.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Two new flags are added to
ng serve
:--public-host
(aliased by--live-reload-client
): Specify the URL that the browser client will use.--disable-host-check
: Don't verify connected clients are part of allowed hosts.Setting
--disable-host-check
will output a warning:See #6070 for more context about this change.
Fix #6070