joepie91 / node-bhttp

A sane HTTP client library for Node.js with Streams2 support.
62 stars 12 forks source link

https->http and http->https redirects break #23

Open jaawerth opened 8 years ago

jaawerth commented 8 years ago

Hi!

Noticed this today - while one can get SSL support by supplying an Agent, the separation causes issues with automatic redirects: if an HTTPS URL redirects to HTTP, or conversely if an HTTP request redirects to HTTPS, the automatic redirect will cause an error. Until SSL is fully supported, it may be helpful to have an "ssllAgent" option or the like for the options object for requests and sessions - it could then select which agent to use depending on the protocol of the URL in the redirect chain.

This would also remove the need to supply the agent for individual requests in a session.