Skip to content
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

bug: alias connection to socket. #1590

Merged
merged 3 commits into from Jun 20, 2019
Merged

bug: alias connection to socket. #1590

merged 3 commits into from Jun 20, 2019

Conversation

mastermatt
Copy link
Member

ClientRequest.connection is an alias for ClientRequest.socket.
https://nodejs.org/api/http.html#http_request_socket
https://github.com/nodejs/node/blob/master/lib/_http_client.js#L640-L641

IncomingMessage.connection is an alias for IncomingMessage.socket.
https://github.com/nodejs/node/blob/master/lib/_http_incoming.js#L44-L45

Adding req.connection and res.connection as a basic EventEmitter was to fix #74 when the request lib use to inspect the alias. This is not the case anymore.
res.connection was removed a few years later to improve coverage.

@mastermatt
Copy link
Member Author

Coveralls is complaining because the whole lib lost two executable lines, however, this change actually brings request_overrider.js up to 100% coverage (#1404).

Copy link
Member

@paulmelnikow paulmelnikow left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up!

lib/request_overrider.js Show resolved Hide resolved
lib/request_overrider.js Show resolved Hide resolved
lib/request_overrider.js Show resolved Hide resolved
Co-Authored-By: Paul Melnikow <github@paulmelnikow.com>
Copy link
Member

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks Matt!

@gr2m gr2m merged commit 659bf01 into nock:beta Jun 20, 2019
@mastermatt mastermatt deleted the req-connection branch June 20, 2019 19:38
@nockbot
Copy link
Collaborator

nockbot commented Jun 20, 2019

🎉 This PR is included in version 11.0.0-beta.20 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nockbot
Copy link
Collaborator

nockbot commented Aug 12, 2019

🎉 This PR is included in version 11.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

gr2m pushed a commit that referenced this pull request Sep 4, 2019
`ClientRequest.connection` is an alias for `ClientRequest.socket`.
https://nodejs.org/api/http.html#http_request_socket
https://github.com/nodejs/node/blob/master/lib/_http_client.js#L640-L641

`IncomingMessage.connection` is an alias for `IncomingMessage.socket`.
https://github.com/nodejs/node/blob/master/lib/_http_incoming.js#L44-L45

Co-Authored-By: Paul Melnikow <github@paulmelnikow.com>
gr2m pushed a commit that referenced this pull request Sep 4, 2019
`ClientRequest.connection` is an alias for `ClientRequest.socket`.
https://nodejs.org/api/http.html#http_request_socket
https://github.com/nodejs/node/blob/master/lib/_http_client.js#L640-L641

`IncomingMessage.connection` is an alias for `IncomingMessage.socket`.
https://github.com/nodejs/node/blob/master/lib/_http_incoming.js#L44-L45

Co-Authored-By: Paul Melnikow <github@paulmelnikow.com>
gr2m pushed a commit that referenced this pull request Sep 5, 2019
`ClientRequest.connection` is an alias for `ClientRequest.socket`.
https://nodejs.org/api/http.html#http_request_socket
https://github.com/nodejs/node/blob/master/lib/_http_client.js#L640-L641

`IncomingMessage.connection` is an alias for `IncomingMessage.socket`.
https://github.com/nodejs/node/blob/master/lib/_http_incoming.js#L44-L45

Co-Authored-By: Paul Melnikow <github@paulmelnikow.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants