@@ -3344,15 +3344,19 @@ do_request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusC
33443344 DefaultHost = build_host (<<" access-analyzer" >>, Client1 ),
33453345 URL0 = build_url (DefaultHost , Path , Client1 ),
33463346 PathBin = erlang :iolist_to_binary (Path ),
3347- {URL1 , Host } = aws_util :apply_endpoint_url_override (URL0 , DefaultHost , PathBin , <<" AWS_ENDPOINT_URL_ACCESSANALYZER " >>),
3347+ {URL1 , Host } = aws_util :apply_endpoint_url_override (URL0 , DefaultHost , PathBin , <<" AWS_ENDPOINT_URL_AWS_ACCESSANALYZER " >>),
33483348 URL = aws_request :add_query (URL1 , Query ),
33493349 AdditionalHeaders1 = [ {<<" Host" >>, Host }
33503350 , {<<" Content-Type" >>, <<" application/x-amz-json-1.1" >>}
33513351 ],
33523352 Payload =
33533353 case proplists :get_value (send_body_as_binary , Options ) of
3354- true ->
3355- maps :get (<<" Body" >>, Input , <<" " >>);
3354+ true when is_list (Input ) ->
3355+ proplists :get_value (<<" Body" >>, Input , <<" " >>);
3356+ true when Input =:= undefined ->
3357+ <<" " >>;
3358+ true ->
3359+ maps :get (<<" Body" >>, Input , <<" " >>);
33563360 false ->
33573361 encode_payload (Input )
33583362 end ,
@@ -3429,6 +3433,7 @@ build_host(_EndpointPrefix, #{region := <<"local">>}) ->
34293433 <<" localhost" >>;
34303434build_host (EndpointPrefix , #{region := Region , endpoint := Endpoint }) ->
34313435 aws_util :binary_join ([EndpointPrefix , Region , Endpoint ], <<" ." >>).
3436+
34323437build_url (Host , Path0 , Client ) ->
34333438 Proto = aws_client :proto (Client ),
34343439 Path = erlang :iolist_to_binary (Path0 ),
@@ -3440,3 +3445,4 @@ encode_payload(undefined) ->
34403445 <<>>;
34413446encode_payload (Input ) ->
34423447 jsx :encode (Input ).
3448+
0 commit comments