From b314201e12e1d865ee2de4e56254aef193ff2018 Mon Sep 17 00:00:00 2001 From: George Fu Date: Tue, 8 Oct 2024 15:20:41 +0000 Subject: [PATCH] chore: add default accepts header for rpcv2Cbor --- private/smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts | 1 + .../typescript/codegen/protocols/cbor/SmithyRpcV2Cbor.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/private/smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts b/private/smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts index c9bc4e334f8..f587c35593c 100644 --- a/private/smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts +++ b/private/smithy-rpcv2-cbor/src/protocols/Rpcv2cbor.ts @@ -1243,4 +1243,5 @@ const throwDefaultError = withBaseException(__BaseException); const SHARED_HEADERS: __HeaderBag = { "content-type": "application/cbor", "smithy-protocol": "rpc-v2-cbor", + accept: "application/cbor", }; diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/SmithyRpcV2Cbor.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/SmithyRpcV2Cbor.java index 4b1971864a9..ce9a10a9cd8 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/SmithyRpcV2Cbor.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/protocols/cbor/SmithyRpcV2Cbor.java @@ -266,7 +266,8 @@ protected void writeSharedRequestHeaders(GenerationContext context) { writer.openBlock("const SHARED_HEADERS: __HeaderBag = {", "};", () -> { writer.write("'content-type': $S,", getDocumentContentType()); writer.write(""" - "smithy-protocol": "rpc-v2-cbor" + "smithy-protocol": "rpc-v2-cbor", + "accept": "application/cbor", """); }); }