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

Legacy API of Agent.prototype.addRequest() #11756

Closed
vsemozhetbyt opened this issue Mar 9, 2017 · 2 comments
Closed

Legacy API of Agent.prototype.addRequest() #11756

vsemozhetbyt opened this issue Mar 9, 2017 · 2 comments
Labels
http Issues or PRs related to the http subsystem. question Issues that look for answers.

Comments

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Mar 9, 2017

  • Subsystem: http

Agent.prototype.addRequest() in the _http_agent.js checks for a Legacy API with a string type of the options parameter. However, this method called only with this call chain:

http.request() in http.js -> exports.ClientRequest() in _http_client.js -> Agent.prototype.addRequest() in the _http_agent.js.

On the ClientRequest() stage any string is converted to Object.

Is there any reason to keep this Legacy API check in the Agent.prototype.addRequest()? Is this function called from a userland or in any other way?

@mscdex mscdex added http Issues or PRs related to the http subsystem. question Issues that look for answers. labels Mar 9, 2017
@vsemozhetbyt
Copy link
Contributor Author

vsemozhetbyt commented Mar 10, 2017

There are some agent subclasses using this today. Despite the addRequest function being undocumented internal API, it's easy enough to just support the old signature for backwards compatibility.

12cd133

Is this info still valid?

(It seems there is only one test with the legacy API)

@vsemozhetbyt
Copy link
Contributor Author

I will close it as deleting the check does not give any performance gain according to my benchmarking anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem. question Issues that look for answers.
Projects
None yet
Development

No branches or pull requests

2 participants