-
Notifications
You must be signed in to change notification settings - Fork 311
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
Sanitize Headers on Errors #507
Conversation
!error.response || | ||
!error.response.request || | ||
(!error.response.request._data && !error.response.request._header) | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a huge fan of this formatting, but the pre-commit hook did this, so 🤷
} | ||
|
||
Object.keys(collection).forEach(function(key) { | ||
if (key.toLowerCase().match('password|secret|authorization')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a big fan of such block list approach. This would miss keys such as token
, bearer
, auth
, key
and so on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidpatrick any thoughts?
Changes
Sanitize the authorization header on errors, as we do with passwords and secrets.
Testing
Checklist