Skip to content

Commit

Permalink
Add missing Content-Type headers to @httpPayload protocol tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
david-perez authored and JordonPhillips committed Jun 13, 2024
1 parent 0564c53 commit 2b066a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use smithy.test#httpResponseTests
{
id: "RestJsonEnumPayloadRequest",
uri: "/EnumPayload",
headers: { "Content-Type": "text/plain" },
body: "enumvalue",
params: { payload: "enumvalue" },
method: "POST",
Expand All @@ -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",
Expand All @@ -44,6 +46,7 @@ enum StringEnum {
{
id: "RestJsonStringPayloadRequest",
uri: "/StringPayload",
headers: { "Content-Type": "text/plain" },
body: "rawstring",
params: { payload: "rawstring" },
method: "POST",
Expand All @@ -53,6 +56,7 @@ enum StringEnum {
@httpResponseTests([
{
id: "RestJsonStringPayloadResponse",
headers: { "Content-Type": "text/plain" },
body: "rawstring",
params: { payload: "rawstring" },
protocol: "aws.protocols#restJson1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use smithy.test#httpResponseTests
{
id: "RestXmlEnumPayloadRequest",
uri: "/EnumPayload",
headers: { "Content-Type": "text/plain" },
body: "enumvalue",
params: { payload: "enumvalue" },
method: "POST",
Expand All @@ -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",
Expand All @@ -44,6 +46,7 @@ enum StringEnum {
{
id: "RestXmlStringPayloadRequest",
uri: "/StringPayload",
headers: { "Content-Type": "text/plain" },
body: "rawstring",
params: { payload: "rawstring" },
method: "POST",
Expand All @@ -53,6 +56,7 @@ enum StringEnum {
@httpResponseTests([
{
id: "RestXmlStringPayloadResponse",
headers: { "Content-Type": "text/plain" },
body: "rawstring",
params: { payload: "rawstring" },
protocol: "aws.protocols#restXml",
Expand Down

0 comments on commit 2b066a1

Please sign in to comment.