-
Notifications
You must be signed in to change notification settings - Fork 30k
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
doc: remove port from example in url.hostname
#45927
doc: remove port from example in url.hostname
#45927
Conversation
doc/api/url.md
Outdated
@@ -251,15 +251,15 @@ const myURL = new URL('https://example.org:81/foo'); | |||
console.log(myURL.hostname); | |||
// Prints example.org | |||
|
|||
// Setting the hostname does not change the port | |||
// Setting an invalid hostname is ignored: |
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.
// Setting an invalid hostname is ignored: | |
// Setting the hostname does not change the port |
The sentence on line 265 already clarifies that invalid host name values are ignored.
doc/api/url.md
Outdated
@@ -251,15 +251,15 @@ const myURL = new URL('https://example.org:81/foo'); | |||
console.log(myURL.hostname); | |||
// Prints example.org | |||
|
|||
// Setting the hostname does not change the port | |||
// Setting an invalid hostname is ignored: | |||
myURL.hostname = 'example.com:82'; |
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.
myURL.hostname = 'example.com:82'; | |
myURL.hostname = 'example.com'; |
doc/api/url.md
Outdated
myURL.hostname = 'example.com:82'; | ||
console.log(myURL.href); | ||
// Prints https://example.com:81/foo | ||
// Prints https://example.org:81/foo |
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.
// Prints https://example.org:81/foo | |
// Prints https://example.com:81/foo |
doc/api/url.md
Outdated
|
||
// Use myURL.host to change the hostname and port | ||
myURL.host = 'example.org:82'; | ||
myURL.host = 'example.com:82'; |
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.
myURL.host = 'example.com:82'; | |
myURL.host = 'example.org:82'; |
doc/api/url.md
Outdated
console.log(myURL.href); | ||
// Prints https://example.org:82/foo | ||
// Prints https://example.com:82/foo |
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.
// Prints https://example.com:82/foo | |
// Prints https://example.org:82/foo |
@lpinca I understand your intention. Then how about adding
|
@deokjinkim why? It's already written on line 265
The only change required is |
@lpinca I thought wrong use-case can help user. But applied your suggestion because your suggestion is reasonable. |
Commit Queue failed- Loading data for nodejs/node/pull/45927 ✔ Done loading data for nodejs/node/pull/45927 ----------------------------------- PR info ------------------------------------ Title doc: fix wrong output of example in `url.hostname` (#45927) Author Deokjin Kim (@deokjinkim) Branch deokjinkim:221221_fix_wrong_output_url -> nodejs:main Labels doc, url, author ready, commit-queue-squash Commits 4 - doc: fix wrong output of example in `url.hostname` - Update doc/api/url.md - Change hostname using host - Address reviewer's comment Committers 2 - Deokjin Kim - GitHub PR-URL: https://github.com/nodejs/node/pull/45927 Reviewed-By: Antoine du Hamel Reviewed-By: Mohammed Keyvanzadeh ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/45927 Reviewed-By: Antoine du Hamel Reviewed-By: Mohammed Keyvanzadeh -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last review: ⚠ - Address reviewer's comment ℹ This PR was created on Wed, 21 Dec 2022 02:11:53 GMT ✔ Approvals: 2 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/45927#pullrequestreview-1225856058 ✔ - Mohammed Keyvanzadeh (@VoltrexKeyva): https://github.com/nodejs/node/pull/45927#pullrequestreview-1226411171 ✔ Last GitHub CI successful ℹ Green GitHub CI is sufficient -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/3762762798 |
@deokjinkim would you be so kind to squash the commits and update the final commit message to be consistent with the change? Thank you. |
If port is used for `url.hostname`, `url.hostname` is not working. So remove port from example in `url.hostname`.
3c5ae76
to
6ece8fd
Compare
url.hostname
url.hostname
@lpinca I squashed commits. Thank your for your review and guide. :) |
Commit Queue failed- Loading data for nodejs/node/pull/45927 ✔ Done loading data for nodejs/node/pull/45927 ----------------------------------- PR info ------------------------------------ Title doc: remove port from example in `url.hostname` (#45927) Author Deokjin Kim (@deokjinkim) Branch deokjinkim:221221_fix_wrong_output_url -> nodejs:main Labels doc, url, author ready, commit-queue-failed Commits 1 - doc: remove port from example in `url.hostname` Committers 1 - Deokjin Kim PR-URL: https://github.com/nodejs/node/pull/45927 Reviewed-By: Antoine du Hamel Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Luigi Pinca ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/45927 Reviewed-By: Antoine du Hamel Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Luigi Pinca -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last review: ⚠ - doc: remove port from example in `url.hostname` ℹ This PR was created on Wed, 21 Dec 2022 02:11:53 GMT ✔ Approvals: 3 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/45927#pullrequestreview-1225856058 ✔ - Mohammed Keyvanzadeh (@VoltrexKeyva): https://github.com/nodejs/node/pull/45927#pullrequestreview-1226411171 ✔ - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/45927#pullrequestreview-1228759740 ✔ Last GitHub CI successful ℹ Green GitHub CI is sufficient -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/3770111597 |
Landed in 2ad3b02 |
If port is used for `url.hostname`, `url.hostname` is not working. So remove port from example in `url.hostname`. PR-URL: #45927 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
If port is used for `url.hostname`, `url.hostname` is not working. So remove port from example in `url.hostname`. PR-URL: #45927 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
If port is used for `url.hostname`, `url.hostname` is not working. So remove port from example in `url.hostname`. PR-URL: #45927 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
If port is used for `url.hostname`, `url.hostname` is not working. So remove port from example in `url.hostname`. PR-URL: #45927 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
If port is used for `url.hostname`, `url.hostname` is not working. So remove port from example in `url.hostname`. PR-URL: #45927 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
If port is used for
url.hostname
,url.hostname
is not working. So remove port from example inurl.hostname
.