Skip to content

Commit

Permalink
fix regression
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Oct 21, 2019
1 parent 9be5796 commit 001ebc1
Show file tree
Hide file tree
Showing 3 changed files with 1,236 additions and 2 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const assert = require('assert');
const crypto = require('crypto');
const querystring = require('querystring');
const https = require('https');
const http = require('http');
const Debug = require('debug');
const nodeFetch = require('node-fetch');
const OAuth = require('oauth-1.0a');
Expand Down Expand Up @@ -33,7 +34,7 @@ const supportedMethods = Object.values(commands).reduce((memo, num) => memo + nu
async function fetch(url, opts) {
return nodeFetch(url, {
...opts,
agent: new https.Agent({ minVersion: 'TLSv1' }),
agent: ({ protocol }) => (protocol === 'http:' ? new http.Agent() : new https.Agent({ minVersion: 'TLSv1' })),
});
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"dependencies": {
"debug": "^3.1.0",
"node-fetch": "^1.7.3",
"node-fetch": "^2.6.0",
"oauth-1.0a": "^2.2.2"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 001ebc1

Please sign in to comment.