Skip to content

setcors on file puts file #1386

@StefanBrand

Description

@StefanBrand

I mistakenly used setcors on a file. It seems to silently overwrite the file.

Steps to reproduce

$ echo '<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <AllowedMethod>POST</AllowedMethod>
        <AllowedMethod>DELETE</AllowedMethod>
        <AllowedMethod>PUT</AllowedMethod>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>
' >  cors_config.xml
$ s3cmd setcors cors_config.xml s3://test-bucket/test.txt
$ s3cmd get s3://stefans-bucket/test.txt -
download: 's3://stefans-bucket/test.txt' -> '-'  [1 of 1]
 378 of 378   100% in    0s  1381.92 B/s<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <AllowedMethod>POST</AllowedMethod>
        <AllowedMethod>DELETE</AllowedMethod>
        <AllowedMethod>PUT</AllowedMethod>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>
 378 of 378   100% in    0s  1378.01 B/s  done

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions