Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Private/ServiceName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ internal static class ServiceName
{
internal const string OpenSearchServerless = "aoss";
internal const string S3 = "s3";
internal const string VpcLatticeService = "vpc-lattice-svcs";
}
}
5 changes: 4 additions & 1 deletion src/Private/Signer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ public static async Task<Result> SignAsync(

UpdateRequestUri(request, baseAddress);

var contentHash = await ContentHash.CalculateAsync(request.Content).ConfigureAwait(false);
var contentHash = serviceName == ServiceName.VpcLatticeService ?
"UNSIGNED-PAYLOAD" :
await ContentHash.CalculateAsync(request.Content).ConfigureAwait(false);

AddHeaders(request, now, serviceName, credentials, contentHash);

Expand Down Expand Up @@ -136,6 +138,7 @@ private static void AddHeaders(
request.AddHeaderIf(credentials.UseToken, HeaderKeys.XAmzSecurityTokenHeader, credentials.Token);
request.AddHeaderIf(!request.Headers.Contains(HeaderKeys.HostHeader), HeaderKeys.HostHeader, request.RequestUri!.Host);
request.AddHeaderIf(serviceName == ServiceName.OpenSearchServerless, HeaderKeys.XAmzContentSha256Header, contentHash);
request.AddHeaderIf(serviceName == ServiceName.VpcLatticeService, HeaderKeys.XAmzContentSha256Header, contentHash);
request.AddHeaderIf(serviceName == ServiceName.S3, HeaderKeys.XAmzContentSha256Header, contentHash);
}

Expand Down