From 2ef09df31b37752b7c1dd85f35488e84ab05bb7d Mon Sep 17 00:00:00 2001 From: Ankur Oberoi Date: Thu, 7 Mar 2019 11:24:21 -0800 Subject: [PATCH] clean up comments --- src/WebClient.ts | 4 ++++ test/proxy/test.js | 7 ++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/WebClient.ts b/src/WebClient.ts index 3cef9064a..f082abeb9 100644 --- a/src/WebClient.ts +++ b/src/WebClient.ts @@ -177,6 +177,10 @@ export class WebClient extends EventEmitter { transformRequest: [this.serializeApiCallOptions.bind(this)], validateStatus: () => true, // all HTTP status codes should result in a resolved promise (as opposed to only 2xx) maxRedirects: 0, + // disabling axios' automatic proxy support: + // axios would read from envvars to configure a proxy automatically, but it doesn't support TLS destinations. + // for compatibility with https://api.slack.com, and for a larger set of possible proxies (SOCKS or other + // protocols), users of this package should use the `agent` option to configure a proxy. proxy: false, }); // serializeApiCallOptions will always determine the appropriate content-type diff --git a/test/proxy/test.js b/test/proxy/test.js index 1c0540e0a..452dee23d 100644 --- a/test/proxy/test.js +++ b/test/proxy/test.js @@ -40,11 +40,8 @@ describe('with a proxy server listening', function () { delete process.env.http_proxy; }); - // NOTE: we are intentionally using a non-TLS URL here to make this test effective. - // it turns out that axios' automatic proxy support (which we've disabled) doesn't support TLS connections via - // proxies, while the https-proxy-agent package does. so the only want to test whether the automatic proxy support - // is actually turned off is to use an http (non-TLS) API URL, because otherwise we'd still see the effect that - // the proxy was not called, and that would be a false positive. + // NOTE: we are intentionally using a non-TLS URL here to make this test effective. otherwise we'd still see the + // effect that the proxy was not called, and that would be a false positive. const client = new WebClient(undefined, { slackApiUrl: 'http://example.com/', retryConfig: retryPolicies.rapidRetryPolicy