// This blurs entire auth string if no space found, because -1 from indexOf.
const blurredAuthHeader = authHeader.slice(0, spaceIndex + 1) + '*'.repeat(authHeader.length - (spaceIndex + 1));
// New headers object, as we change it.
- newValue.headers = Object.assign({}, newValue.headers, {
+ newValue.headers = {
+ ...newValue.headers,
authorization: blurredAuthHeader,
- });
+ };
}
value = newValue;
}