Skip to content

Commit

Permalink
Merge pull request #165 from aws-beam/issue-161-uri_encode_path-in-aw…
Browse files Browse the repository at this point in the history
…s_bedrock_runtime

uri_encode_path in aws_bedrock_runtime
  • Loading branch information
onno-vos-dev authored Jan 27, 2025
2 parents 2bc8289 + de6e3a8 commit 1193a43
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/aws_bedrock.erl
Original file line number Diff line number Diff line change
Expand Up @@ -5004,7 +5004,7 @@ do_request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusC
Headers1 = aws_request:add_headers(AdditionalHeaders, Headers0),

MethodBin = aws_request:method_to_binary(Method),
SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload),
SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload, [{uri_encode_path, true}]),
Response = hackney:request(Method, URL, SignedHeaders, Payload, Options),
DecodeBody = not proplists:get_value(receive_body_as_binary, Options),
handle_response(Response, SuccessStatusCode, DecodeBody).
Expand Down
2 changes: 1 addition & 1 deletion src/aws_bedrock_agent.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6510,7 +6510,7 @@ do_request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusC
Headers1 = aws_request:add_headers(AdditionalHeaders, Headers0),

MethodBin = aws_request:method_to_binary(Method),
SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload),
SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload, [{uri_encode_path, true}]),
Response = hackney:request(Method, URL, SignedHeaders, Payload, Options),
DecodeBody = not proplists:get_value(receive_body_as_binary, Options),
handle_response(Response, SuccessStatusCode, DecodeBody).
Expand Down
2 changes: 1 addition & 1 deletion src/aws_bedrock_agent_runtime.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2413,7 +2413,7 @@ do_request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusC
Headers1 = aws_request:add_headers(AdditionalHeaders, Headers0),

MethodBin = aws_request:method_to_binary(Method),
SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload),
SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload, [{uri_encode_path, true}]),
Response = hackney:request(Method, URL, SignedHeaders, Payload, Options),
DecodeBody = not proplists:get_value(receive_body_as_binary, Options),
handle_response(Response, SuccessStatusCode, DecodeBody).
Expand Down
2 changes: 1 addition & 1 deletion src/aws_bedrock_data_automation.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ do_request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusC
Headers1 = aws_request:add_headers(AdditionalHeaders, Headers0),

MethodBin = aws_request:method_to_binary(Method),
SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload),
SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload, [{uri_encode_path, true}]),
Response = hackney:request(Method, URL, SignedHeaders, Payload, Options),
DecodeBody = not proplists:get_value(receive_body_as_binary, Options),
handle_response(Response, SuccessStatusCode, DecodeBody).
Expand Down
2 changes: 1 addition & 1 deletion src/aws_bedrock_data_automation_runtime.erl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ do_request(Client, Action, Input0, Options) ->
Input = Input0,

Payload = jsx:encode(Input),
SignedHeaders = aws_request:sign_request(Client1, <<"POST">>, URL, Headers, Payload),
SignedHeaders = aws_request:sign_request(Client1, <<"POST">>, URL, Headers, Payload, [{uri_encode_path, true}]),
Response = hackney:request(post, URL, SignedHeaders, Payload, Options),
handle_response(Response).

Expand Down
2 changes: 1 addition & 1 deletion src/aws_bedrock_runtime.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ do_request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusC
Headers1 = aws_request:add_headers(AdditionalHeaders, Headers0),

MethodBin = aws_request:method_to_binary(Method),
SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload),
SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload, [{uri_encode_path, true}]),
Response = hackney:request(Method, URL, SignedHeaders, Payload, Options),
DecodeBody = not proplists:get_value(receive_body_as_binary, Options),
handle_response(Response, SuccessStatusCode, DecodeBody).
Expand Down

0 comments on commit 1193a43

Please sign in to comment.