Skip to content

Commit 7ac0e7c

Browse files
Minor reformatting
1 parent 6056f83 commit 7ac0e7c

File tree

1 file changed

+17
-25
lines changed

1 file changed

+17
-25
lines changed

deps/oauth2_client/src/oauth2_client.erl

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -592,39 +592,35 @@ append_extra_parameters(Request, QueryList) ->
592592
map_ssl_options_to_httpc_option(SslOptions) ->
593593
case SslOptions of
594594
undefined -> [];
595-
Options -> [{ssl, Options}]
595+
Options -> [{ssl, Options}]
596596
end.
597597

598598
map_timeout_to_httpc_option(Timeout) ->
599599
case Timeout of
600600
undefined -> [{timeout, ?DEFAULT_HTTP_TIMEOUT}];
601-
Timeout -> [{timeout, Timeout}]
601+
Timeout -> [{timeout, Timeout}]
602602
end.
603603

604604
map_proxy_to_httpc_option(ProxyOptions) ->
605605
case ProxyOptions of
606-
undefined ->
607-
[];
608-
Proxy -> case {Proxy#proxy_options.host, Proxy#proxy_options.port} of
606+
undefined -> [];
607+
Proxy -> case {Proxy#proxy_options.host, Proxy#proxy_options.port} of
609608
{undefined, 0} -> [];
610-
{_, 0} -> [];
609+
{_, 0} -> [];
611610
{undefined, _} -> [];
612-
{Host, Port} ->
613-
P = {{Host, Port},[]},
614-
[{proxy, P}]
611+
{Host, Port} -> P = {{Host, Port},[]},
612+
[{proxy, P}]
615613
end
616614
end.
617615

618616
map_proxy_auth_to_httpc_option(ProxyOptions) ->
619617
case ProxyOptions of
620-
undefined ->
621-
[];
622-
Proxy ->
623-
case {Proxy#proxy_options.username, Proxy#proxy_options.password} of
624-
{undefined, _} -> [];
625-
{_, undefined} -> [];
626-
{_, _} = Auth -> [{proxy_auth, Auth}]
627-
end
618+
undefined -> [];
619+
Proxy -> case {Proxy#proxy_options.username, Proxy#proxy_options.password} of
620+
{undefined, _} -> [];
621+
{_, undefined} -> [];
622+
{_, _} = Auth -> [{proxy_auth, Auth}]
623+
end
628624
end.
629625

630626
is_json(?CONTENT_JSON) -> true;
@@ -637,10 +633,8 @@ is_json(_) -> false.
637633
decode_body(_, []) -> [];
638634
decode_body(?CONTENT_JSON, Body) ->
639635
case rabbit_json:try_decode(rabbit_data_coercion:to_binary(Body)) of
640-
{ok, Value} ->
641-
Value;
642-
{error, _} = Error ->
643-
Error
636+
{ok, Value} -> Value;
637+
{error, _} = Error -> Error
644638
end;
645639
decode_body(MimeType, Body) ->
646640
Items = string:split(MimeType, ";"),
@@ -688,10 +682,8 @@ map_to_oauth_provider(PropList) when is_list(PropList) ->
688682
}.
689683
map_to_access_token_response(Code, Reason, Headers, Body) ->
690684
case decode_body(proplists:get_value("content-type", Headers, ?CONTENT_JSON), Body) of
691-
{error, {error, InternalError}} ->
692-
{error, InternalError};
693-
{error, _} = Error ->
694-
Error;
685+
{error, {error, InternalError}} -> {error, InternalError};
686+
{error, _} = Error -> Error;
695687
Value ->
696688
case Code of
697689
200 -> {ok, map_to_successful_access_token_response(Value)};

0 commit comments

Comments
 (0)