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(
187
187
AsyncSignRequest <? extends AwsCredentialsIdentity > request ,
188
188
V4Properties properties ) {
189
189
190
- boolean isPayloadSigning = ! asyncShouldTreatAsUnsigned (request );
190
+ boolean isPayloadSigning = isPayloadSigning (request );
191
191
boolean isEventStreaming = isEventStreaming (request .request ());
192
192
boolean isChunkEncoding = request .requireProperty (CHUNK_ENCODING_ENABLED , false );
193
193
boolean isTrailing = request .request ().firstMatchingHeader (X_AMZ_TRAILER ).isPresent ();
@@ -204,6 +204,13 @@ private static V4PayloadSigner v4PayloadAsyncSigner(
204
204
throw new UnsupportedOperationException ("Unsigned payload is not supported with event-streaming." );
205
205
}
206
206
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
+
207
214
if (useChunkEncoding (isPayloadSigning , isChunkEncoding , isTrailing || isFlexible )) {
208
215
return AwsChunkedV4PayloadSigner .builder ()
209
216
.credentialScope (properties .getCredentialScope ())
You can’t perform that action at this time.
0 commit comments