Skip to content

Commit 069ddaf

Browse files
authored
Properly set content-type for RPCv2 event streams (#5897)
1 parent 6c74e87 commit 069ddaf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/protocols/aws-json-protocol/src/main/java/software/amazon/awssdk/protocols/json/internal/marshall/JsonProtocolMarshaller.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ private SdkHttpFullRequest finishMarshalling() {
280280
if (!request.firstMatchingHeader(CONTENT_TYPE).isPresent() && !hasEvent) {
281281
if (hasEventStreamingInput) {
282282
AwsJsonProtocol protocol = protocolMetadata.protocol();
283-
if (protocol == AwsJsonProtocol.AWS_JSON) {
283+
if (protocol == AwsJsonProtocol.AWS_JSON || protocol == AwsJsonProtocol.SMITHY_RPC_V2_CBOR) {
284284
// For RPC formats, this content type will later be pushed down into the `initial-event` in the body
285285
request.putHeader(CONTENT_TYPE, contentType);
286-
} else if (protocol == AwsJsonProtocol.REST_JSON || protocol == AwsJsonProtocol.SMITHY_RPC_V2_CBOR) {
286+
} else if (protocol == AwsJsonProtocol.REST_JSON) {
287287
request.putHeader(CONTENT_TYPE, MIMETYPE_EVENT_STREAM);
288288
} else {
289289
throw new IllegalArgumentException("Unknown AwsJsonProtocol: " + protocol);

0 commit comments

Comments
 (0)