Skip to content

Commit 2ba49f0

Browse files
authored
Merge pull request #120 from aws-beam/uri_encode_path-in-aws_bedrock_runtime
uri_encode_path in aws_bedrock_runtime
2 parents acb7a87 + f830fad commit 2ba49f0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

priv/post.erl.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ request(Client, Action, Input, Options) ->
9090
Input = Input0,
9191
<% end %>
9292
Payload = <%= context.encode %>,
93-
SignedHeaders = aws_request:sign_request(Client1, <<"POST">>, URL, Headers, Payload),
93+
SignedHeaders = aws_request:sign_request(Client1, <<"POST">>, URL, Headers, Payload<%= if context.module_name == "aws_apigatewaymanagementapi" or String.contains?(context.module_name, "aws_bedrock") do %>, [{uri_encode_path, true}]<% else %><% end %>),
9494
Response = hackney:request(post, URL, SignedHeaders, Payload, Options),
9595
handle_response(Response).
9696

priv/rest.erl.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ do_request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusC
231231
Headers1 = aws_request:add_headers(AdditionalHeaders, Headers0),
232232

233233
MethodBin = aws_request:method_to_binary(Method),
234-
SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload<%= if context.module_name == "aws_apigatewaymanagementapi" do %>, [{uri_encode_path, true}]<% else %><% end %>),
234+
SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload<%= if context.module_name == "aws_apigatewaymanagementapi" or String.contains?(context.module_name, "aws_bedrock") do %>, [{uri_encode_path, true}]<% else %><% end %>),
235235
Response = hackney:request(Method, URL, SignedHeaders, Payload, Options),
236236
DecodeBody = not proplists:get_value(receive_body_as_binary, Options),
237237
handle_response(Response, SuccessStatusCode, DecodeBody).

0 commit comments

Comments
 (0)