Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! http: decode username and password before encoding
  • Loading branch information
addaleax committed Jan 21, 2020
commit 76ca7362bc7866c49c7a97010e141b4dac2f1f68
10 changes: 9 additions & 1 deletion doc/api/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,12 @@ the URL, use the [`url.search`][] setter. See [`URLSearchParams`][]
documentation for details.

#### `url.username`
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/31450
description: When used with `http.request()`, this field will now be
percent-decoded.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing -->.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The section on http.request() in http.md seems like a more logical place to me for this note.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The section on http.request() in http.md seems like a more logical place to me for this note.

Why not both? :)


* {string}

Expand All @@ -488,7 +494,8 @@ console.log(myURL.href);
Any invalid URL characters appearing in the value assigned the `username`
property will be [percent-encoded][]. The selection of which
characters to percent-encode may vary somewhat from what the [`url.parse()`][]
and [`url.format()`][] methods would produce.
and [`url.format()`][] methods would produce. When used with
[`http.request()`][], this field will be percent-decoded.

#### `url.toString()`

Expand Down Expand Up @@ -1316,6 +1323,7 @@ console.log(myURL.origin);
[`TypeError`]: errors.html#errors_class_typeerror
[`URLSearchParams`]: #url_class_urlsearchparams
[`array.toString()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString
[`http.request()`]: http.html#http_http_request_options_callback
[`new URL()`]: #url_constructor_new_url_input_base
[`querystring`]: querystring.html
[`require('url').format()`]: #url_url_format_url_options
Expand Down