We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e52750e commit 44bfd83Copy full SHA for 44bfd83
modules/utils/npm.js
@@ -1,5 +1,6 @@
1
import url from 'url';
2
import https from 'https';
3
+import http from 'http';
4
import gunzip from 'gunzip-maybe';
5
import { LRUCache } from 'lru-cache';
6
@@ -37,7 +38,12 @@ const notFound = '';
37
38
39
function get(options) {
40
return new Promise((accept, reject) => {
- https.get(options, accept).on('error', reject);
41
+ if (npmRegistryURL.startsWith('http://')) {
42
+ delete options.agent;
43
+ http.get(options, accept).on('error', reject);
44
+ } else {
45
+ https.get(options, accept).on('error', reject);
46
+ }
47
});
48
}
49
0 commit comments