1 parent e145714 commit ac0c595Copy full SHA for ac0c595
1 file changed
index.js
@@ -32,7 +32,15 @@ function HttpsProxyAgent(opts) {
32
debug('creating new HttpsProxyAgent instance: %o', opts);
33
Agent.call(this, opts);
34
35
- var proxy = Object.assign({}, opts);
+ var proxy;
36
+
37
+ // If the opts are genearted with the WHATWG API
38
+ if (Object.getOwnPropertySymbols(opts)[0]) {
39
+ proxy = Object.keys(opts[Object.getOwnPropertySymbols(opts)[0]]);
40
+ proxy.protocol = proxy.scheme;
41
+ } else {
42
+ proxy = Object.assign({}, opts);
43
+ }
44
45
// if `true`, then connect to the proxy server over TLS. defaults to `false`.
46
this.secureProxy = proxy.protocol ? /^https:?$/i.test(proxy.protocol) : false;
0 commit comments