Merge pull request #11005 from HJianBo/fix-tracing-logs-typos

fix(authn): fix the hardcode method in trace logs
This commit is contained in:
JianBo He 2023-06-10 18:08:28 +08:00 committed by GitHub
commit aea3ae4024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -435,19 +435,19 @@ parse_body(ContentType, _) ->
uri_encode(T) ->
emqx_http_lib:uri_encode(to_list(T)).
request_for_log(Credential, #{url := Url} = State) ->
request_for_log(Credential, #{url := Url, method := Method} = State) ->
SafeCredential = emqx_authn_utils:without_password(Credential),
case generate_request(SafeCredential, State) of
{PathQuery, Headers} ->
#{
method => post,
method => Method,
base_url => Url,
path_query => PathQuery,
headers => Headers
};
{PathQuery, Headers, Body} ->
#{
method => post,
method => Method,
base_url => Url,
path_query => PathQuery,
headers => Headers,

View File

@ -0,0 +1 @@
Fix the issue where the `method` field cannot be correctly printed in the trace logs of AuthN HTTP.