peak / s5cmd

Parallel S3 and local filesystem execution tool.
MIT License
2.7k stars 239 forks source link

cp command S3toS3 --content-type flag not working #738

Closed 4o4x closed 3 months ago

4o4x commented 4 months ago

In s5cmd, the --content-type flag does not work when performing an S3 to S3 copy operation with the cp command.

Tests

Object Info

> aws --endpoint-url=http://localhost:4566 s3api head-object --bucket copy-test --key src/test.txt
{
    "AcceptRanges": "bytes",
    "LastModified": "2024-07-10T08:06:17+00:00",
    "ContentLength": 12,
    "ETag": "\"90a6f0c908b76d95b8d9c0e6405b2fd5\"",
    "ContentType": "text/plain",
    "ServerSideEncryption": "AES256",
    "Metadata": {}
}

AWS CLI Test

> aws --endpoint-url=http://localhost:4566 s3 cp  s3://copy-test/src/test.txt s3://copy-test/dest/test.txt --content-type video/mp4
copy: s3://copy-test/src/test.txt to s3://copy-test/dest/test.txt
> aws --endpoint-url=http://localhost:4566 s3api head-object --bucket copy-test --key dest/test.txt
{
    "AcceptRanges": "bytes",
    "LastModified": "2024-07-10T08:09:34+00:00",
    "ContentLength": 12,
    "ETag": "\"90a6f0c908b76d95b8d9c0e6405b2fd5\"",
    "ContentType": "video/mp4",
    "ServerSideEncryption": "AES256",
    "Metadata": {}
}

s5cmd test

> s5cmd --endpoint-url=http://localhost:4566 cp --content-type video/mp4 s3://copy-test/src/test.txt s3://copy-test/dest/test2.txt
cp s3://copy-test/src/test.txt s3://copy-test/dest/test2.txt
> aws --endpoint-url=http://localhost:4566 s3api head-object --bucket copy-test --key dest/test2.txt
{
    "AcceptRanges": "bytes",
    "LastModified": "2024-07-10T08:17:09+00:00",
    "ContentLength": 12,
    "ETag": "\"90a6f0c908b76d95b8d9c0e6405b2fd5\"",
    "ContentType": "text/plain",
    "ServerSideEncryption": "AES256",
    "Metadata": {}
}