-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: argument types for https & argument types cleanup for http #11681
Conversation
doc/api/https.md
Outdated
- `options` {Object | String} | ||
- `method` {String} Default = `GET` | ||
- `protocol` {String} Default = `http` | ||
- `host` | `hostname` {String} Default = `localhost` |
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.
Maybe put them in separate entries and mention they are aliases?
doc/api/http.md
Outdated
@@ -110,16 +110,16 @@ added: v0.3.4 | |||
|
|||
* `options` {Object} Set of configurable options to set on the agent. | |||
Can have the following fields: | |||
* `keepAlive` {boolean} Keep sockets around even when there are no |
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.
Er..I think lowercased primitive types are preferred after #11167?
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.
Ahh, I had read the summary (which said the opposite) but not the comment thread. Will change.
doc/api/https.md
Outdated
[`tls.createServer()`][]. The `requestListener` is a function which is | ||
- `options` {Object} | ||
- `pfx` {String | Buffer} | ||
- `key` {String | Buffer | Array[strings | buffers | objects]} |
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.
Buffer[] | string[] | Object[]
are supported by the tools now..
doc/api/https.md
Outdated
- `requestListener` {Function} | ||
|
||
Returns a new HTTPS web server object. The `options` are similar to | ||
[`tls.createServer()`][] and [`tls.createSecureContext()`][]. The `requestListener` is a function which is |
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.
nit: 80-characters wrap?
d0bee48
to
ad4ef9c
Compare
Changes made. |
doc/api/http.md
Outdated
- `path` {string} Default = `/` | ||
- `headers` {Object} | ||
- `auth` {string} | ||
- `agent` {Agent | boolean} Default = `globalAgent` |
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.
http.globalAgent
would be clearer
doc/api/https.md
Outdated
- `path` {string} Default = `/` | ||
- `headers` {Object} | ||
- `auth` {string} | ||
- `agent` {Agent | boolean} Default = `globalAgent` |
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.
https.globalAgent
would be clearer(notice https.globalAgent !== http.globalAgent
)
doc/api/https.md
Outdated
<!-- YAML | ||
added: v0.3.6 | ||
--> | ||
- `options` {Object | 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.
Can you merge the type signatures with option explanations below? Thanks!
ad4ef9c
to
a892437
Compare
Updated. 😄 |
a892437
to
9a2862f
Compare
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.
Almost there!
doc/api/http.md
Outdated
@@ -1528,7 +1529,20 @@ added to the [`'request'`][] event. | |||
added: v0.3.6 | |||
--> | |||
|
|||
* `options` {Object} | |||
* `options` {Object | string} | |||
- `protocol` {string} Defaults to `http:`. |
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.
Elsewhere in the change you using the pattern Default = ...
.
Would you please update for consistency? Thank you! 😄
doc/api/https.md
Outdated
happens at the connection level, *before* the HTTP request is sent. Default `true`. | ||
- `secureProtocol` {string} | ||
The SSL method to use, e.g. `SSLv3_method` to force SSL version 3. The | ||
possible values depend on your installation of OpenSSL and are defined in the |
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.
Please replace your
with the
. (in generally we avoid use of pronouns such as you
and your
in the docs. Thank you!
9a2862f
to
bcf0909
Compare
Changes made. |
72af375
to
a2ac3ea
Compare
doc/api/http.md
Outdated
@@ -1528,7 +1528,20 @@ added to the [`'request'`][] event. | |||
added: v0.3.6 | |||
--> | |||
|
|||
* `options` {Object} | |||
* `options` {Object | 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.
Actually, I am not sure if the options need to be explained here since most of them are just passed to http.request
, and that one has a more detailed explanation about these options? Maybe something like
* `options` {Object | string}: Takes the same values as `options` in
[`http.request(options[, callback])`][] except that `method` is set to `GET`
is enough? This way future updates to http.request
don't need to take care of the explanations here.
doc/api/https.md
Outdated
Returns a new HTTPS web server object. The `options` is similar to | ||
[`tls.createServer()`][]. The `requestListener` is a function which is | ||
automatically added to the `'request'` event. | ||
- `options` {Object} |
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.
Same here, tls.createServer()
and tls.createSecureContext()
have a detailed explanation about these options, so linking to the docs of them should be enough. (Of course the signature of options
itself is still necessary)
doc/api/https.md
Outdated
<!-- YAML | ||
added: v0.3.6 | ||
--> | ||
- `options` {Object | 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.
Ditto for http.get
doc/api/https.md
Outdated
<!-- YAML | ||
added: v0.3.6 | ||
--> | ||
- `options` {Object | 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.
Ditto for http.request
, moduloagent
, port
, protocol
differences
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 once @joyeecheung is happy with it also
5966723
to
3f63bd3
Compare
Updated. 😄 |
3f63bd3
to
471bb13
Compare
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.
Looking good, thanks!
Landed in f6b0309...9772fb9 |
This is not landing clearly in |
Ref: nodejs#9399 PR-URL: nodejs#11681 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Ref: nodejs#9399 PR-URL: nodejs#11681 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Ref: nodejs#9399 PR-URL: nodejs#11681 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Ref: nodejs#9399 PR-URL: nodejs#11681 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Are the changes relevant to v6.x? italoacasas@9c3cf13 cherry picks clean. |
ping |
Returns a new HTTPS web server object. The `options` is similar to | ||
[`tls.createServer()`][]. The `requestListener` is a function which is | ||
automatically added to the `'request'` event. | ||
- `options` {Object} Accepts `options` from [`tls.createServer()`][] and [`tls.createSecureContext()`][]. |
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.
long lines. can you please make sure to wrap all lines at <= 80 chars
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.
HA! oops lol... totally missed that this had already landed lol :-D
|
||
Makes a request to a secure web server. | ||
|
||
The following additional `options` from [`tls.connect()`][] are also accepted when using a | ||
custom [`Agent`][]: | ||
`pfx`, `key`, `passphrase`, `cert`, `ca`, `ciphers`, `rejectUnauthorized`, `secureProtocol`, `servername` |
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.
@joyeecheung does this section apply to v6.x as well?
Landed on v6.x-staging, LMK if that was a mistake. |
Checklist
Affected core subsystem(s)
documentation
Description of changes
Added argument data types to the docs for the
https
module.Added missing argument data types to the docs for the
http
module.Lowercased primitive data types in the
http
module for consistency.Changed
Integer
data types toNumber
for consistency.Issue