-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: adding note regarding http.get options #12124
Conversation
doc/api/http.md
Outdated
@@ -1539,6 +1539,8 @@ convenience method. The only difference between this method and | |||
automatically. Note that response data must be consumed in the callback | |||
for reasons stated in [`http.ClientRequest`][] section. | |||
|
|||
Note: The `options` properties are copied via `util._extend()` which doesn't include the prototype. |
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.
Couple of style nits:
- Please wrap at 80 chars
s/Note:/*Note*:/
- Rewording to something like the following is likely sufficient:
*Note*: The `options` object's "own" properties are copied when passed.
The fact that it uses util._extend()
is an internal implementation detail that should not be worth documenting and could change at any point in the future)
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.
I'd like to avoid scare quotes in our docs if possible. Maybe this?:
*Note*: Properties inherited from the `options` object prototype chain are ignored.
Might it be better as part of the explanation of options
and not a special note at the bottom?
* `options` {Object | string} Accepts the same `options` as
[`http.request()`][], with the `method` always set to `GET`.
Properties that are inherited from the prototype are ignored.
Also: Should this note be added to all relevant functions and not just .get()
?
@nodejs/documentation
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.
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.
Works for me.
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.
Okay – added the changes.
Extra notes that options doesn't include the prototype when copied #12092
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.
LGTM.
@jasnell Do you still request your suggested changes? 1 & 3 should be fine now, not sure if I should add the |
Landed in e1161a3 |
Extra notes that options doesn't include the prototype when copied Fixes: nodejs#12092 PR-URL: nodejs#12124 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This addresses #12092. Adds a note to
doc/api/http.md
that clarifies thatoptions
doesn't include the prototype.
Checklist
Affected core subsystem(s)
doc