-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
[6.x] http: make socketPath work with no agent #19425
Conversation
Not sure if it's ok to apply bug fixes directly on v6.x but master and v8.x are not affected by this bug. |
da5c658
to
26e2a50
Compare
lib/_http_client.js
Outdated
? self.agent.createConnection(optionsPath, oncreate) | ||
: typeof options.createConnection === 'function' | ||
? options.createConnection(optionsPath, oncreate) | ||
: net.createConnection(optionsPath, oncreate); |
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.
We don't need to pass oncreate
to net.createConnection()
, it always immediately returns a socket.
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.
Thanks, fixed.
bug fixes against a direct release branch are fine if other branches are unaffects /cc @nodejs/lts for review |
f6a2de7
to
e507d01
Compare
/cc @nodejs/http |
0a4c79b
to
988cca8
Compare
Currently `Agent.prototype.createConnection()` is called uncoditionally if the `socketPath` option is used. This throws an error if no agent is used, preventing, for example, the `socketPath` and `createConnection` options to be used together. This commit fixes the issue by falling back to the `createConnection` option or `net.createConnection()`.
e507d01
to
6cc1820
Compare
Ping @nodejs/collaborators |
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
Currently `Agent.prototype.createConnection()` is called uncoditionally if the `socketPath` option is used. This throws an error if no agent is used, preventing, for example, the `socketPath` and `createConnection` options to be used together. This commit fixes the issue by falling back to the `createConnection` option or `net.createConnection()`. PR-URL: #19425 Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Chen Gang <[email protected]>
landed in 18acad3 |
Currently
Agent.prototype.createConnection()
is called uncoditionallyif the
socketPath
option is used. This throws an error if no agent isused, preventing, for example, the
socketPath
andcreateConnection
options to be used together.
This commit fixes the issue by falling back to the
createConnection
option or
net.createConnection()
.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes