aws / aws-sdk-cpp

AWS SDK for C++
Apache License 2.0
1.96k stars 1.05k forks source link

Enum not present serialization #2875

Closed sbiscigl closed 7 months ago

sbiscigl commented 7 months ago

Issue #, if available:

issues/1961

Description of changes:

Customers have been seeing problems using S3 API compatible implementations that we send a empty string for checksum when it is explicitly set to NOT_SET.

x-amz-sdk-checksum-algorithm: ''

the concept of a enum value not being set is part of our custom enum generation logic, and the serialization of the value falls back on sending a empty string. This change removes sending the header at all.

This is line with the the smithy protocol tests

Do not send null values, empty strings, or empty lists over the wire in headers

removing sending empty string for not present enums will reduce data on the wire, and is more correct according to smithy.

Check all that applies:

Check which platforms you have built SDK on to verify the correctness of this PR.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.