|
|
@@ -405,7 +405,7 @@ on_query(
|
|
|
reason => Reason,
|
|
|
connector => InstId
|
|
|
}),
|
|
|
- Result;
|
|
|
+Result;
|
|
|
_Success ->
|
|
|
Result
|
|
|
end.
|
|
|
@@ -713,9 +713,15 @@ render_request_body(BodyTks, RenderTmplFunc, Msg) ->
|
|
|
|
|
|
encode_payload_with_base64(Msg) ->
|
|
|
Payload = maps:get(payload, Msg, <<>>),
|
|
|
+ PayloadHex = binary_to_hex(Payload),
|
|
|
+ ?SLOG(debug, #{msg => "encode_payload_with_base64", payload_hex => PayloadHex, payload_size => byte_size(Payload)}),
|
|
|
Base64Payload = base64:encode(Payload),
|
|
|
+ ?SLOG(debug, #{msg => "encode_payload_with_base64", Base64Payload => Base64Payload}),
|
|
|
maps:put(payload, Base64Payload, Msg).
|
|
|
|
|
|
+% 辅助函数:将二进制数据转换为16进制字符串
|
|
|
+binary_to_hex(Bin) ->
|
|
|
+ lists:flatten([io_lib:format("~2.16.0B", [Byte]) || <<Byte>> <= Bin]).
|
|
|
render_headers(HeaderTks, RenderTmplFunc, Msg) ->
|
|
|
lists:map(
|
|
|
fun({K, V}) ->
|
|
|
@@ -915,4 +921,4 @@ join_paths_test_() ->
|
|
|
?_assertEqual("abc///cde/", join_paths("abc//", "//cde/"))
|
|
|
].
|
|
|
|
|
|
--endif.
|
|
|
+-endif.
|