Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't mutate configuration when updating http agent #42

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

James-Burba
Copy link

The accounts team had an SNS outage due to utils.setHttpAgent mutating the config that is passed in to it. The SQS wrapper passes a config that other services use to this function, and since bypassProxy = true by default in the SQS wrapper, the proxy agent is reset for all other services that use that config.

@nancyhabecker
Copy link
Contributor

Copy link
Contributor

@ischer ischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd probably add the _.omit back in, and potentially a unit test to be added that ensures that the config object doesn't get mutated. beyond that, this LGTM

expect(awsMock).to.have.been.calledWith({
httpOptions: { agent: sinon.match.any }
});
expect(config).to.deep.equal({ bypassProxy: 'a value' });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Base automatically changed from master to main February 24, 2021 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants