molnarg / node-http2

An HTTP/2 client and server implementation for node.js
MIT License
1.79k stars 185 forks source link

Fix bug when calling request with agent option #184

Closed felicienfrancois closed 8 years ago

felicienfrancois commented 8 years ago

Fix https://github.com/molnarg/node-http2/issues/174

Before the internal https.Agent of http2.Agent were left to the agent from the request option (http2.Agent instance)

nwgh commented 8 years ago

This seems pretty incorrect, to me - it blindly overwrites options.agent, when it's entirely possible that using the passed-in agent is exactly what the caller wants to have happen (assuming the passed-in agent exposes the proper API, of course).

I think what we really want to have is an appropriate API forwarding shim between http2.Agent and https.Agent.