From 056e31693bd47e90798e293b784fa90a6bdf0716 Mon Sep 17 00:00:00 2001 From: Landon James Date: Thu, 24 Oct 2024 09:08:57 -0700 Subject: [PATCH] Update NullAndEmptyHeadersServer tests The test now align with the similar tests for clients. They expect empty headers to be serialized as "" and null headers to not be serialized --- .../model/restJson1/http-headers.smithy | 12 ++++++++---- .../model/restXml/http-headers.smithy | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/smithy-aws-protocol-tests/model/restJson1/http-headers.smithy b/smithy-aws-protocol-tests/model/restJson1/http-headers.smithy index 78fd9c909f1..2b5115004df 100644 --- a/smithy-aws-protocol-tests/model/restJson1/http-headers.smithy +++ b/smithy-aws-protocol-tests/model/restJson1/http-headers.smithy @@ -412,7 +412,7 @@ structure InputAndOutputWithHeadersIO { headerIntegerEnumList: IntegerEnumList, } -/// Null and empty headers are not sent over the wire. +/// Null headers are not sent over the wire, empty headers are serialized to "" @readonly @http(uri: "/NullAndEmptyHeadersClient", method: "GET") @tags(["client-only"]) @@ -443,7 +443,7 @@ apply NullAndEmptyHeadersClient @httpRequestTests([ }, ]) -/// Null and empty headers are not sent over the wire. +/// Null headers are not sent over the wire, empty headers are serialized to "" @readonly @http(uri: "/NullAndEmptyHeadersServer", method: "GET") @tags(["server-only"]) @@ -455,10 +455,14 @@ operation NullAndEmptyHeadersServer { apply NullAndEmptyHeadersServer @httpResponseTests([ { id: "RestJsonNullAndEmptyHeaders", - documentation: "Do not send null or empty headers", + documentation: "Do not send null values, but do send empty strings and empty lists over the wire in headers", protocol: restJson1, code: 200, - forbidHeaders: ["X-A", "X-B", "X-C"], + forbidHeaders: ["X-A"], + headers: { + "X-B": "" + "X-C": "" + } params: { a: null, b: "", diff --git a/smithy-aws-protocol-tests/model/restXml/http-headers.smithy b/smithy-aws-protocol-tests/model/restXml/http-headers.smithy index 2bf49ffc933..6fc91964de1 100644 --- a/smithy-aws-protocol-tests/model/restXml/http-headers.smithy +++ b/smithy-aws-protocol-tests/model/restXml/http-headers.smithy @@ -355,7 +355,7 @@ structure InputAndOutputWithHeadersIO { headerEnumList: FooEnumList, } -/// Null and empty headers are not sent over the wire. +/// Null headers are not sent over the wire, empty headers are serialized to "" @readonly @http(uri: "/NullAndEmptyHeadersClient", method: "GET") @tags(["client-only"]) @@ -386,7 +386,7 @@ apply NullAndEmptyHeadersClient @httpRequestTests([ }, ]) -/// Null and empty headers are not sent over the wire. +/// Null headers are not sent over the wire, empty headers are serialized to "" @readonly @http(uri: "/NullAndEmptyHeadersServer", method: "GET") @tags(["server-only"]) @@ -398,10 +398,14 @@ operation NullAndEmptyHeadersServer { apply NullAndEmptyHeadersServer @httpResponseTests([ { id: "NullAndEmptyHeaders", - documentation: "Do not send null or empty headers", + documentation: "Do not send null values, but do send empty strings and empty lists over the wire in headers", protocol: restXml, code: 200, - forbidHeaders: ["X-A", "X-B", "X-C"], + forbidHeaders: ["X-A"], + headers: { + "X-B": "" + "X-C": "" + } body: "", params: { a: null,