Skip to content

Commit 0a44a5b

Browse files
Better object property detection
1 parent 91f1213 commit 0a44a5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/api_client/execute_request.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ function execute_request(method, params, auth, api_url, callback, options = {})
7070
const sanitized_request_options = {...request_options};
7171

7272
if (hide_sensitive === true){
73-
if (sanitized_request_options.auth) { delete sanitized_request_options.auth; }
74-
if (sanitized_request_options.headers) { delete sanitized_request_options.headers.Authorization; }
73+
if ("auth" in sanitized_request_options) { delete sanitized_request_options.auth; }
74+
if ("Authorization" in sanitized_request_options.headers) { delete sanitized_request_options.headers.Authorization; }
7575
}
7676

7777
if (includes([200, 400, 401, 403, 404, 409, 420, 500], res.statusCode)) {

0 commit comments

Comments
 (0)