Skip to content

Wrong legacy API parameter caused by typo in _http_agent.js #5051

@asukakenji

Description

@asukakenji

At https://github.com/nodejs/node/blob/master/lib/_http_agent.js#L114:

The line should read:

      localAddress: arguments[3]

instead of:

      path: arguments[3]

The localAddress parameter was added to the addRequest() function in lib/http.js since 1e9bcf2#diff-1c0f1c434b17b7f8795d44a51a14320a.

The function was then refactored into _http_agent.js at 12cd133.

However, the localAddress parameter was mistaken to be path during the refactoring. Below are some evidences showing that the parameter should be localAddress.

Here is the current code in master:

Here is how the options object is used. It clearly expects localAddress:

Here is the code in an old release (v0.10.36, which is the version currently used on AWS):

These clears shows the format host:port:localAddress:

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that are suitable for first-time contributors.httpIssues or PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions