Repository navigation
https: Agent.createConnection mutates options object #31119
Description
Activity
Good first issue?
- changed the title
[-]https: createConnection mutates options object[/-][+]https: Agent.createConnection mutates options object[/+]on Dec 28, 2019 - addedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.httpsIssues and PRs related to the https subsystem.Issues and PRs related to the https subsystem.
on Dec 30, 2019 Hey @ronag , @Trott . I would like to go fix this issue. I have read the
CONTRIBUTING.mdfile. Is there anything else I need to know before proceeding like should I just create a pull request after solving the issue or do I have to do something else as well? This is my first time contributing to an open-source project. Any help would be appreciated.Reacted by Ruben Bridgewater@vighnesh153: Create a PR and follow the instructions. Also please add a test that fails before fix and succeeds after fix.
Reacted by Ruben Bridgewater and Vighnesh RautAlright. I will start working on it right away.
Reacted by Ruben BridgewaterIn the
lib/_http_agent.js, I can see a line:
Agent.prototype.createConnection = net.createConnection;
That leads me to thelib/net.jsfile. There, I sawmodule.exports = { ..., createConnection: connect, ... }So, from there, I went to
connectdefinition and its comment-doc says that it has 3 forms:// There are various forms: // // connect(options, [cb]) // connect(port, [host], [cb]) // connect(path, [cb]);None of them matches the one that is mentioned in the issue. Am I looking at the correct function?
Also, I see a
testdirectory and inside it, there are several other directories. One of them beinginternet. Should I add a new test file in that directory or should I use an existing one?You should be looking for
httpsnothttp.See the test in
test/parallelfor examples and you should either add a new test there or modify and existing one.Reacted by Vighnesh RautOk. Got it. I will look into that.
While running the tests, some of the tests pass, but many others throw unhandled errors. I haven't touched the code yet. Am I missing out on something?
Edit:
Those were some experimental features. I guess I should ignore those errors.- added a commit that references this issue
on Jan 6, 2020 - added a commit that references this issue
on Jan 14, 2020 - added a commit that references this issue
on Feb 6, 2020
createConnectionshould create a copy instead of mutating the passed options object.