Skip to content

Commit

Permalink
Merge pull request #112 from aws-beam/fix-correct-signing-name-based-…
Browse files Browse the repository at this point in the history
…on-proper-field

Fix correct signing_name based on aws.auth#sigv4 and fall back to endpoint_prefix only if not available
  • Loading branch information
onno-vos-dev committed Jun 7, 2024
2 parents e04adcf + 799e7d5 commit 22a7403
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/aws_codegen/post_service.ex
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ defmodule AWS.CodeGen.PostService do
content_type = @configuration[protocol][:content_type]
content_type = content_type <> if protocol == "json", do: json_version, else: ""

signing_name =
maybe_signing_name =
if String.starts_with?(endpoint_prefix, "api.") do
String.replace(endpoint_prefix, "api.", "")
else
endpoint_prefix
end
signing_name = traits["aws.auth#sigv4"]["name"] || maybe_signing_name

%Service{
actions: actions,
Expand Down

0 comments on commit 22a7403

Please sign in to comment.