fix(http connector): remove sensitive info from headers lazily

In production code we don't need to redact the headers for a trace that
will never appear anywhere so we can improve performance by doing
removal of sensitive information lazily.
This commit is contained in:
Kjell Winblad 2024-04-25 13:27:14 +02:00
parent ef9884cf47
commit ff09f14191
1 changed files with 2 additions and 2 deletions

View File

@ -512,7 +512,7 @@ trace_rendered_action_template(ActionId, Host, Method, NRequest, Timeout) ->
host => Host,
path => Path,
method => Method,
headers => emqx_utils_redact:redact_headers(Headers),
headers => {fun emqx_utils_redact:redact_headers/1, Headers},
timeout => Timeout
}
);
@ -523,7 +523,7 @@ trace_rendered_action_template(ActionId, Host, Method, NRequest, Timeout) ->
host => Host,
path => Path,
method => Method,
headers => emqx_utils_redact:redact_headers(Headers),
headers => {fun emqx_utils_redact:redact_headers/1, Headers},
timeout => Timeout,
body => {fun log_format_body/1, Body}
}