aws/aws-sdk-net

S3 objects' ETag wrapped in quote

Closed this issue · 4 comments

Hi,
I couldn't find any documentation regarding this, so I decided to open this issue.

Basically when I access an S3 object via both the SDK or the PowerShell cmdlets, I get the objects' ETag wrapped in double quotes.

Expected Behavior

S3 objects' ETags should contain only the actual hash

Current Behavior

S3 objects' ETags are wrapped in double quotes

Steps to Reproduce (for bugs)

In PowerShell
Get-S3Object -BucketName my-test-bucket -ProfileName My

returns

ETag         : "3e25960a79dbc69b674cd4ec67a72c62"
BucketName   : my-test-bucket
Key          : Capri/Test/HelloWorld.txt
LastModified : 13/12/2017 17:55:03
Owner        : Amazon.S3.Model.Owner
Size         : 11
StorageClass : STANDARD

The same happens when using AWSSDK.S3 3.3.x

normj commented

I agree it is odd that it is quoted but that is how S3 returns the ETag. In theory we could have the SDK auto strip the quotes but that would be a breaking change at this point which we can't do.

So it's an S3 quirk? I was trying to understand that but I couldn't get the etag out of the VS extension.

normj commented

Yeap, and S3 quirk. Closing as I believe this is answered.

For anyone else brought here by a search, double-quoted eTags are spec compliant, it turns out: https://tools.ietf.org/html/rfc2616#section-14.19

Credit goes to this SO answer: https://stackoverflow.com/a/59383943/79225