X-Git-Url: https://git.squeep.com/?p=squeep-logger-json-console;a=blobdiff_plain;f=lib%2Fjson-replacers.js;fp=lib%2Fjson-replacers.js;h=14ac3343ac348e7803eeac458b8386a1a18f266b;hp=51eacb3cb5f2c8a259ce0bf55496ec64391fbb79;hb=1f557bcdd06dfdba6ce7485bd6307db3359dcb08;hpb=337ca7b3a7a1c3ad0dedd452d741f9fde57f6df9 diff --git a/lib/json-replacers.js b/lib/json-replacers.js index 51eacb3..14ac334 100644 --- a/lib/json-replacers.js +++ b/lib/json-replacers.js @@ -62,9 +62,10 @@ function replacerHttpIncomingMessage(_key, value) { // 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; }