From e5d83edb8e9327610631b7601bae5b7950cb36ac Mon Sep 17 00:00:00 2001 From: Luis Madrigal <599908+Madrigal@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:07:01 -0400 Subject: [PATCH] Update prefix header tests to allow for empty headers (#2415) --- .../restJson1/http-prefix-headers.smithy | 19 ++++++++++++++++++- .../model/restXml/http-prefix-headers.smithy | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/smithy-aws-protocol-tests/model/restJson1/http-prefix-headers.smithy b/smithy-aws-protocol-tests/model/restJson1/http-prefix-headers.smithy index 8c279b6aadb..5d4123a56d7 100644 --- a/smithy-aws-protocol-tests/model/restJson1/http-prefix-headers.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/http-prefix-headers.smithy @@ -42,7 +42,7 @@ apply HttpPrefixHeaders @httpRequestTests([ }, { id: "RestJsonHttpPrefixHeadersAreNotPresent", - documentation: "No prefix headers are serialized because the value is empty", + documentation: "No prefix headers are serialized because the value is not present", protocol: restJson1, method: "GET", uri: "/HttpPrefixHeaders", @@ -56,6 +56,23 @@ apply HttpPrefixHeaders @httpRequestTests([ }, appliesTo: "client" }, + { + id: "RestJsonHttpPrefixEmptyHeaders", + documentation: "Serialize prefix headers were the value is present but empty" + protocol: restJson1, + method: "GET", + uri: "/HttpPrefixHeaders", + body: "", + params: { + fooMap: { + Abc: "" + } + }, + headers: { + "X-Foo-Abc": "" + } + appliesTo: "client", + }, ]) apply HttpPrefixHeaders @httpResponseTests([ diff --git a/smithy-aws-protocol-tests/model/restXml/http-prefix-headers.smithy b/smithy-aws-protocol-tests/model/restXml/http-prefix-headers.smithy index eb99631c59a..a17cc658efb 100644 --- a/smithy-aws-protocol-tests/model/restXml/http-prefix-headers.smithy +++ b/smithy-aws-protocol-tests/model/restXml/http-prefix-headers.smithy @@ -41,7 +41,7 @@ apply HttpPrefixHeaders @httpRequestTests([ }, { id: "HttpPrefixHeadersAreNotPresent", - documentation: "No prefix headers are serialized because the value is empty", + documentation: "No prefix headers are serialized because the value is not present", protocol: restXml, method: "GET", uri: "/HttpPrefixHeaders", @@ -55,6 +55,23 @@ apply HttpPrefixHeaders @httpRequestTests([ }, appliesTo: "client" }, + { + id: "HttpPrefixEmptyHeaders", + documentation: "Serialize prefix headers were the value is present but empty" + protocol: restXml, + method: "GET", + uri: "/HttpPrefixHeaders", + body: "", + params: { + fooMap: { + Abc: "" + } + }, + headers: { + "X-Foo-Abc": "" + } + appliesTo: "client", + }, ]) apply HttpPrefixHeaders @httpResponseTests([