Aws copy-object api with** x-amz-copy-source-if-modified-since** parameter evaluates as false, copies data . I think aws should throw error and not copy data.
C:>fsutil file createnew 5m.txt 5242880
File C:\5m.txt is created
aws s3api put-object --bucket sb31 --key 5m --body 5m.txt
{
"ETag": ""5f363e0e58a95f06cbe9bbc662c5dfb6""
}
aws s3api head-object --bucket sb31 --key 5m
{
"AcceptRanges": "bytes",
"LastModified": "2022-07-19T13:13:51+00:00",
"ContentLength": 5242880,
"ETag": ""5f363e0e58a95f06cbe9bbc662c5dfb6"",
"ContentType": "binary/octet-stream",
"Metadata": {}
}
aws s3api copy-object --bucket sb31 --key 6m --copy-source sb31/5m --copy-source-if-modified-since 2022-07-20 (this is false evaluation, still copies data)
{
"CopyObjectResult": {
"ETag": ""5f363e0e58a95f06cbe9bbc662c5dfb6"",
"LastModified": "2022-07-19T13:16:02+00:00"
}
}
aws s3api copy-object --bucket sb31 --key 6m --copy-source sb31/5m --copy-source-if-modified-since 2022-07-19
{
"CopyObjectResult": {
"ETag": ""5f363e0e58a95f06cbe9bbc662c5dfb6"",
"LastModified": "2022-07-19T13:16:13+00:00"
}
}
aws s3api copy-object --bucket sb31 --key 6m --copy-source sb31/5m --copy-source-if-modified-since 2022-07-29
{
"CopyObjectResult": {
"ETag": ""5f363e0e58a95f06cbe9bbc662c5dfb6"",
"LastModified": "2022-07-19T13:16:26+00:00"
}
}