Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterOdin committed Nov 28, 2023
1 parent 9da01f8 commit bcd7789
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/presto-client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ Client.prototype.request = function(opts, callback) {
if (opts.body)
contentBody = opts.body;

// `agents` is a custom property that follow-redirects supports, where
// it's similar to setting `agent`, but allows for setting it per protocol,
// so that if we redirect from http -> https (or vice versa) we use the right
// agent, instead of trying to reuse http.Agent for https (or vice versa) which
// will error.
opts.agents = {
http: new http.Agent({ keepAlive: false }),
https: new https.Agent({ ...client.ssl, keepAlive: false }),
Expand Down

0 comments on commit bcd7789

Please sign in to comment.