Skip to content

Commit 4b8b790

Browse files
committed
Updates
1 parent d301273 commit 4b8b790

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/DefaultAwsV4HttpSigner.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ private static V4PayloadSigner v4PayloadAsyncSigner(
187187
AsyncSignRequest<? extends AwsCredentialsIdentity> request,
188188
V4Properties properties) {
189189

190-
boolean isPayloadSigning = !asyncShouldTreatAsUnsigned(request);
190+
boolean isPayloadSigning = isPayloadSigning(request);
191191
boolean isEventStreaming = isEventStreaming(request.request());
192192
boolean isChunkEncoding = request.requireProperty(CHUNK_ENCODING_ENABLED, false);
193193
boolean isTrailing = request.request().firstMatchingHeader(X_AMZ_TRAILER).isPresent();
@@ -204,6 +204,13 @@ private static V4PayloadSigner v4PayloadAsyncSigner(
204204
throw new UnsupportedOperationException("Unsigned payload is not supported with event-streaming.");
205205
}
206206

207+
// Note: this check is done after we check if the request is eventstreaming, during which we just use the normal logic
208+
// as sync to determine if the body should be signed. If it's not eventstreaming, hen async needs to treat this request
209+
// as unsigned to maintain current behavior re: plain HTTP requests.
210+
if (asyncShouldTreatAsUnsigned(request)) {
211+
isPayloadSigning = false;
212+
}
213+
207214
if (useChunkEncoding(isPayloadSigning, isChunkEncoding, isTrailing || isFlexible)) {
208215
return AwsChunkedV4PayloadSigner.builder()
209216
.credentialScope(properties.getCredentialScope())

0 commit comments

Comments
 (0)