Skip to content

Commit 257d4e7

Browse files
rrosttmarcolinkmakinwab
authored
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 <[email protected]> Co-authored-by: Makinwa Olubukola <[email protected]>
1 parent 48cc8b6 commit 257d4e7

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

lib/contentful.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ function obscureAuthTokenInResponse (http) {
103103

104104
error.response.config.headers.Authorization = error.response.config.headers.Authorization.replace(token, `Bearer...${token.substr(-5)}`)
105105

106-
if (error.response.request._headers && error.response.request._headers.authorization) {
107-
error.response.request._headers.authorization = error.response.request._headers.authorization.replace(token, `Bearer...${token.substr(-5)}`)
108-
}
109-
110106
if (error.response.request._header) {
111107
error.response.request._header = error.response.request._header.replace(token, `Bearer...${token.substr(-5)}`)
112108
}

0 commit comments

Comments
 (0)