From 3ca60f2cdf10f08eacf636ddfbea5e586b067575 Mon Sep 17 00:00:00 2001 From: david-perez Date: Tue, 11 Jun 2024 17:08:01 +0200 Subject: [PATCH] Add missing `Content-Type` headers to @httpPayload protocol tests As per the specs for these protocols, a `Content-Type` header should be set. Server should reject requests when an expected `Content-Type` header is not found (protcol tests for that are added in #2314). - https://smithy.io/2.0/aws/protocols/aws-restjson1-protocol.html#content-type - https://smithy.io/2.0/aws/protocols/aws-restxml-protocol.html#content-type --- .../model/restJson1/http-string-payload.smithy | 4 ++++ .../model/restXml/http-string-payload.smithy | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/smithy-aws-protocol-tests/model/restJson1/http-string-payload.smithy b/smithy-aws-protocol-tests/model/restJson1/http-string-payload.smithy index 8aa1f517b43..52cab5cc99f 100644 --- a/smithy-aws-protocol-tests/model/restJson1/http-string-payload.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/http-string-payload.smithy @@ -10,6 +10,7 @@ use smithy.test#httpResponseTests { id: "RestJsonEnumPayloadRequest", uri: "/EnumPayload", + headers: { "Content-Type": "text/plain" }, body: "enumvalue", params: { payload: "enumvalue" }, method: "POST", @@ -19,6 +20,7 @@ use smithy.test#httpResponseTests @httpResponseTests([ { id: "RestJsonEnumPayloadResponse", + headers: { "Content-Type": "text/plain" }, body: "enumvalue", params: { payload: "enumvalue" }, protocol: "aws.protocols#restJson1", @@ -44,6 +46,7 @@ enum StringEnum { { id: "RestJsonStringPayloadRequest", uri: "/StringPayload", + headers: { "Content-Type": "text/plain" }, body: "rawstring", params: { payload: "rawstring" }, method: "POST", @@ -53,6 +56,7 @@ enum StringEnum { @httpResponseTests([ { id: "RestJsonStringPayloadResponse", + headers: { "Content-Type": "text/plain" }, body: "rawstring", params: { payload: "rawstring" }, protocol: "aws.protocols#restJson1", diff --git a/smithy-aws-protocol-tests/model/restXml/http-string-payload.smithy b/smithy-aws-protocol-tests/model/restXml/http-string-payload.smithy index 851e34066e3..9b25b3af094 100644 --- a/smithy-aws-protocol-tests/model/restXml/http-string-payload.smithy +++ b/smithy-aws-protocol-tests/model/restXml/http-string-payload.smithy @@ -10,6 +10,7 @@ use smithy.test#httpResponseTests { id: "RestXmlEnumPayloadRequest", uri: "/EnumPayload", + headers: { "Content-Type": "text/plain" }, body: "enumvalue", params: { payload: "enumvalue" }, method: "POST", @@ -19,6 +20,7 @@ use smithy.test#httpResponseTests @httpResponseTests([ { id: "RestXmlEnumPayloadResponse", + headers: { "Content-Type": "text/plain" }, body: "enumvalue", params: { payload: "enumvalue" }, protocol: "aws.protocols#restXml", @@ -44,6 +46,7 @@ enum StringEnum { { id: "RestXmlStringPayloadRequest", uri: "/StringPayload", + headers: { "Content-Type": "text/plain" }, body: "rawstring", params: { payload: "rawstring" }, method: "POST", @@ -53,6 +56,7 @@ enum StringEnum { @httpResponseTests([ { id: "RestXmlStringPayloadResponse", + headers: { "Content-Type": "text/plain" }, body: "rawstring", params: { payload: "rawstring" }, protocol: "aws.protocols#restXml",