aws / aws-sdk-cpp

AWS SDK for C++
Apache License 2.0
1.98k stars 1.06k forks source link

Fix curl headers when value is absent #2750

Closed sbiscigl closed 1 year ago

sbiscigl commented 1 year ago

Description of changes:

Right now if a S3 request is made like

PutObjectRequest().WithMetadata({{"KeyWithValue", "value"}, {"KeyWithoutValue", ""}});

this will result in a curl request with headers like

[DEBUG] 2023-11-14 15:37:57.397 CURL [0x1de241b40] (HeaderOut) PUT /test.txt HTTP/1.1
Host: sbiscigl.s3.us-east-1.amazonaws.com
...
x-amz-meta-keywithvalue: value
...

without the header without value. after this change it will look like

[DEBUG] 2023-11-14 15:42:21.551 CURL [0x1de241b40] (HeaderOut) PUT /test.txt HTTP/1.1
...
x-amz-meta-keywithoutvalue:
x-amz-meta-keywithvalue: value
...

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.