Skip to content

Commit e5d83ed

Browse files
authored
Update prefix header tests to allow for empty headers (#2415)
1 parent f630cbb commit e5d83ed

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

smithy-aws-protocol-tests/model/restJson1/http-prefix-headers.smithy

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ apply HttpPrefixHeaders @httpRequestTests([
4242
},
4343
{
4444
id: "RestJsonHttpPrefixHeadersAreNotPresent",
45-
documentation: "No prefix headers are serialized because the value is empty",
45+
documentation: "No prefix headers are serialized because the value is not present",
4646
protocol: restJson1,
4747
method: "GET",
4848
uri: "/HttpPrefixHeaders",
@@ -56,6 +56,23 @@ apply HttpPrefixHeaders @httpRequestTests([
5656
},
5757
appliesTo: "client"
5858
},
59+
{
60+
id: "RestJsonHttpPrefixEmptyHeaders",
61+
documentation: "Serialize prefix headers were the value is present but empty"
62+
protocol: restJson1,
63+
method: "GET",
64+
uri: "/HttpPrefixHeaders",
65+
body: "",
66+
params: {
67+
fooMap: {
68+
Abc: ""
69+
}
70+
},
71+
headers: {
72+
"X-Foo-Abc": ""
73+
}
74+
appliesTo: "client",
75+
},
5976
])
6077

6178
apply HttpPrefixHeaders @httpResponseTests([

smithy-aws-protocol-tests/model/restXml/http-prefix-headers.smithy

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ apply HttpPrefixHeaders @httpRequestTests([
4141
},
4242
{
4343
id: "HttpPrefixHeadersAreNotPresent",
44-
documentation: "No prefix headers are serialized because the value is empty",
44+
documentation: "No prefix headers are serialized because the value is not present",
4545
protocol: restXml,
4646
method: "GET",
4747
uri: "/HttpPrefixHeaders",
@@ -55,6 +55,23 @@ apply HttpPrefixHeaders @httpRequestTests([
5555
},
5656
appliesTo: "client"
5757
},
58+
{
59+
id: "HttpPrefixEmptyHeaders",
60+
documentation: "Serialize prefix headers were the value is present but empty"
61+
protocol: restXml,
62+
method: "GET",
63+
uri: "/HttpPrefixHeaders",
64+
body: "",
65+
params: {
66+
fooMap: {
67+
Abc: ""
68+
}
69+
},
70+
headers: {
71+
"X-Foo-Abc": ""
72+
}
73+
appliesTo: "client",
74+
},
5875
])
5976

6077
apply HttpPrefixHeaders @httpResponseTests([

0 commit comments

Comments
 (0)