Skip to content

Commit 1cf286d

Browse files
committed
Follow-up fix to 14655
Follow-up to #14655 The code to format `cacerts` and `certs_keys` needs to check if the incoming value is a list or map, and skip it if not. This is the same pattern as used in a later function head: ``` format_socket_opts([Head = {Name, Value} | Tail], Acc) when is_list(Value) -> ``` It ensures that the code won't be called again on an already-formatted value.
1 parent 5a3b62b commit 1cf286d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

deps/rabbitmq_aws/include/rabbitmq_aws.hrl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
| {ok, {status_code(), body()}}
138138
| {error, term()}.
139139

140-
-type result_ok() :: {ok, {ResponseHeaders :: headers(), Response :: list()}}.
140+
-type result_ok() :: {ok, {ResponseHeaders :: headers(), Response :: body()}}.
141141
-type result_error() ::
142142
{'error', Message :: reason_phrase(),
143143
{ResponseHeaders :: headers(), Response :: list()} | undefined}

deps/rabbitmq_management_agent/src/rabbit_mgmt_format.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,13 @@ format_socket_opts([{user_lookup_fun, _Value} | Tail], Acc) ->
318318
format_socket_opts([{sni_fun, _Value} | Tail], Acc) ->
319319
format_socket_opts(Tail, Acc);
320320
%% https://www.erlang.org/doc/apps/ssl/ssl.html#t:server_option_cert/0
321-
format_socket_opts([{cacerts, Cacerts} | Tail], Acc) ->
321+
format_socket_opts([{cacerts, Cacerts} | Tail], Acc) when is_list(Cacerts) ->
322322
CacertsMsg = rabbit_data_coercion:to_utf8_binary(
323323
io_lib:format("(~b cacerts entries)", [length(Cacerts)])),
324324
format_socket_opts(Tail, [{cacerts, CacertsMsg} | Acc]);
325325
%% https://www.erlang.org/doc/apps/ssl/ssl.html#t:common_option_cert/0
326326
%% https://www.erlang.org/doc/apps/ssl/ssl.html#t:cert_key_conf/0
327-
format_socket_opts([{certs_keys, CertsKeys} | Tail], Acc) ->
327+
format_socket_opts([{certs_keys, CertsKeys} | Tail], Acc) when is_map(CertsKeys) ->
328328
CertsKeysMsg = rabbit_data_coercion:to_utf8_binary(
329329
io_lib:format("(~b certs_keys entries)", [length(CertsKeys)])),
330330
format_socket_opts(Tail, [{cacerts, CertsKeysMsg} | Acc]);

0 commit comments

Comments
 (0)