You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some inconsistencies with what the documentation states and what the http2 actually does regarding the http2.connect(authority, options, ...) method.
The documentation states that the method accepts both net.connect(...) and tls.connect(...) options, but if you pass in an authority object with the connection details and an options object with extra details, the method is inconsistent when deciding if authority should take precedence over options depending on if it uses net.connect(...) and tls.connect(...).
Assume that a server is running on localhost:1050, then consider:
Make `options.host` and `options.port` take precedence over
`authority.host` and `authority.port` respectively.
PR-URL: #28584Fixes: #28182
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Make `options.host` and `options.port` take precedence over
`authority.host` and `authority.port` respectively.
PR-URL: #28584Fixes: #28182
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
There are some inconsistencies with what the documentation states and what the http2 actually does regarding the
http2.connect(authority, options, ...)
method.The documentation states that the method accepts both
net.connect(...)
andtls.connect(...)
options, but if you pass in anauthority
object with the connection details and anoptions
object with extra details, the method is inconsistent when deciding ifauthority
should take precedence overoptions
depending on if it usesnet.connect(...)
andtls.connect(...)
.Assume that a server is running on
localhost:1050
, then consider:and
In the first scenario, the connection will be successful since
net.connect(...)
uses the host and port in the authority arg, and ignores the options arg (if they're already defined in authority).In the second scenario, since the connection is using
tls.connect(...)
instead ofnet.connect(...)
, theoptions
object will take precedence overauthority
.The text was updated successfully, but these errors were encountered: