From 257d4e7509c07d687b079830f83b9b11641858fb Mon Sep 17 00:00:00 2001 From: Mattias Rost Date: Thu, 9 Sep 2021 15:23:57 +0200 Subject: [PATCH] fix: remove use of the deprecated OutgoingMessage.prototype._headers Removes deprecated code. Cannot replace with setHeaders since headers already sent. In case you still want to obscure the headers from the request-object i suggest you strip down the request object to only include desired attributes, rather than changing the original object. Co-authored-by: Marco Link Co-authored-by: Makinwa Olubukola --- lib/contentful.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/contentful.js b/lib/contentful.js index d9e9a10e0..5610aa7f6 100644 --- a/lib/contentful.js +++ b/lib/contentful.js @@ -103,10 +103,6 @@ function obscureAuthTokenInResponse (http) { error.response.config.headers.Authorization = error.response.config.headers.Authorization.replace(token, `Bearer...${token.substr(-5)}`) - if (error.response.request._headers && error.response.request._headers.authorization) { - error.response.request._headers.authorization = error.response.request._headers.authorization.replace(token, `Bearer...${token.substr(-5)}`) - } - if (error.response.request._header) { error.response.request._header = error.response.request._header.replace(token, `Bearer...${token.substr(-5)}`) }