| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
| // 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.
Sorry, something went wrong.
There was a problem hiding this comment.
| myURL.hostname = 'example.com:82'; | |
| myURL.hostname = 'example.com'; |
Sorry, something went wrong.
There was a problem hiding this comment.
| // Prints https://example.org:81/foo | |
| // Prints https://example.com:81/foo |
Sorry, something went wrong.
There was a problem hiding this comment.
| myURL.host = 'example.com:82'; | |
| myURL.host = 'example.org:82'; |
Sorry, something went wrong.
There was a problem hiding this comment.
| // Prints https://example.com:82/foo | |
| // Prints https://example.org:82/foo |
Sorry, something went wrong.
|
@lpinca I understand your intention. Then how about adding invalid hostname as last one like below? If you confirm, I'll update commit. const myURL = new URL('https://example.org:81/foo');
console.log(myURL.hostname);
// Prints example.org
// Setting the hostname does not change the port
myURL.hostname = 'example.com';
console.log(myURL.href);
// Prints https://example.com:81/foo
// Use myURL.host to change the hostname and port
myURL.host = 'example.org:82';
console.log(myURL.href);
// Prints https://example.org:82/foo
// Setting an invalid hostname is ignored
myURL.hostname = 'example.com:81';
console.log(myURL.href);
// Prints https://example.org:82/foo
|
Sorry, something went wrong.
|
@deokjinkim why? It's already written on line 265
The only change required is myURL.hostname = 'example.com:82'; -> myURL.hostname = 'example.com';. Everything else is correct as is. |
Sorry, something went wrong.
@lpinca I thought wrong use-case can help user. But applied your suggestion because your suggestion is reasonable. |
Sorry, something went wrong.
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 |
Sorry, something went wrong.
|
@deokjinkim would you be so kind to squash the commits and update the final commit message to be consistent with the change? Thank you. |
Sorry, something went wrong.
If port is used for `url.hostname`, `url.hostname` is not working. So remove port from example in `url.hostname`.
@lpinca I squashed commits. Thank your for your review and guide. :) |
Sorry, something went wrong.
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 |
Sorry, something went wrong.
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 <duhamelantoine1995@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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 <duhamelantoine1995@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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 <duhamelantoine1995@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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 <duhamelantoine1995@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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 <duhamelantoine1995@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
| Back | FazBrowse Home | New Git URL |
If port is used for url.hostname, url.hostname is not working. So remove port from example in url.hostname.