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

Fix assignments for scrub_headers and scrub_fields. #137

Merged
merged 1 commit into from
Oct 3, 2014

Conversation

jondeandres
Copy link
Contributor

These assignments were done wrong, ||= should be used instead of |=, which is a binary operator. The response of both methods is probably not expected:

irb(main):001:0> a = nil
=> nil
irb(main):002:0> a |= 'this will not be set'
=> true
irb(main):003:0> a
=> true

This is mostly what could happen if Rollbar.configuration.scrub_fields is nil. Instead of assign a value to the config attribute I've used just || to return the first value if exists or the second.

end

def sensitive_headers_list
Rollbar.configuration.scrub_headers |= []
Rollbar.configuration.scrub_headers || []
Copy link
Member

Choose a reason for hiding this comment

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

This change looks good

@jondeandres jondeandres force-pushed the fix-variable-assignments branch from d556d1f to a7960d7 Compare October 3, 2014 01:07
@jondeandres
Copy link
Contributor Author

@brianr changed

brianr added a commit that referenced this pull request Oct 3, 2014
Fix assignments for scrub_headers and scrub_fields.
@brianr brianr merged commit cdaae62 into rollbar:master Oct 3, 2014
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.

2 participants