Skip to content

Commit aaa6b34

Browse files
Fix dialyzer error
1 parent 69426de commit aaa6b34

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

deps/rabbitmq_auth_backend_oauth2/src/rabbit_oauth2_resource_server.erl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,26 +167,16 @@ find_audience(Audience, ResourceIdList) when is_binary(Audience) ->
167167
AudList = binary:split(Audience, <<" ">>, [global, trim_all]),
168168
find_audience(AudList, ResourceIdList);
169169
find_audience(AudList, ResourceIdList) when is_list(AudList) ->
170-
?LOG_DEBUG("find_audience ~p -> ~p vs ~p", [AudList,
171-
normalize_to_binary_list(AudList), ResourceIdList]),
172170
case intersection(normalize_to_binary_list(AudList), ResourceIdList) of
173171
[One] -> {ok, One};
174172
[_One|_Tail] -> {error, aud_matched_many_resource_servers_only_one_allowed};
175173
[] -> {error, no_matching_aud_found}
176174
end.
177175

178176
-spec normalize_to_binary_list(binary() | string() | [binary()]) -> [binary()].
177+
normalize_to_binary_list([H | _] = List) when is_binary(H) -> List;
179178
normalize_to_binary_list(Input) when is_list(Input) ->
180-
case Input of
181-
[H | _] when is_binary(H) ->
182-
Input;
183-
_ when is_list(Input) ->
184-
[unicode:characters_to_binary(Part) || Part <- string:tokens(Input, " ")];
185-
_ ->
186-
[]
187-
end;
188-
normalize_to_binary_list(Input) when is_binary(Input) ->
189-
binary:split(Input, <<" ">>, [global]).
179+
[unicode:characters_to_binary(Part) || Part <- string:tokens(Input, " ")].
190180

191181
-spec translate_error_if_any(
192182
{ok, resource_server()} |

0 commit comments

Comments
 (0)