Skip to content

Commit

Permalink
clean up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aoberoi committed Mar 7, 2019
1 parent 4b81bfd commit 2ef09df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/WebClient.ts
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions test/proxy/test.js
Expand Up @@ -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
Expand Down

0 comments on commit 2ef09df

Please sign in to comment.