File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff 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 ())
You can’t perform that action at this time.
0 commit comments