R2 storage - issue with 'x-amz-acl'

hello, thanks, and sorry as a newbie if i posted in the wrong area of the forum,

i am testing R2, Cloudflare s3.

i understand that r2 does not support x-amz-acl
but seems that r2 will accept X-Amz-Acl: private but not X-Amz-Acl: public-read-write

imho, r2 should fail to accept both headers?

so am i confused about:
the documentation
or
does r2 just accept/ignore accept X-Amz-Acl: private

here r2 accepts ``X-Amz-Acl`

2022/05/12 10:59:59 DEBUG : HTTP REQUEST (req 0xc0007d6300)
2022/05/12 10:59:59 DEBUG : PUT /test HTTP/1.1
Host: b85f4e968aaefd001d2f659b5c8bcee9.r2.cloudflarestorage.com
User-Agent: rclone/v1.59.0-beta.6124.6f91198b5
Content-Length: 148
Authorization: XXXX
X-Amz-Acl: private
X-Amz-Content-Sha256: ff3d8073a0d2d5772934f4998496695fa231028bf5de7412e9525b08e4463062
X-Amz-Date: 20220512T145959Z
Accept-Encoding: gzip

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2022/05/12 11:00:00 DEBUG : HTTP RESPONSE (req 0xc0007d6300)
2022/05/12 11:00:00 DEBUG : HTTP/1.1 200 OK

here here r2 rejects `X-Amz-Acl

2022/05/12 10:21:19 DEBUG : HTTP REQUEST (req 0xc0007d3f00)
2022/05/12 10:21:19 DEBUG : PUT /test HTTP/1.1
Host: b85f4e968aaefd001d2f659b5c8bcee9.r2.cloudflarestorage.com
User-Agent: rclone/v1.59.0-beta.6124.6f91198b5
Content-Length: 148
Authorization: XXXX
X-Amz-Acl: public-read-write
X-Amz-Content-Sha256: ff3d8073a0d2d5772934f4998496695fa231028bf5de7412e9525b08e4463062
X-Amz-Date: 20220512T142119Z
Accept-Encoding: gzip

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2022/05/12 10:21:20 DEBUG : HTTP RESPONSE (req 0xc0007d3f00)
2022/05/12 10:21:20 DEBUG : HTTP/1.1 501 Not Implemented

X-Amz-Acl: private is ‘correct’ since the buckets are private - even if it’s a no-op in the background.

Accepting X-Amz-Acl: public-read-write would imply that the object you created has the public-read-write ACL when that isn’t true, so it’s best to reject it to avoid confusion.

2 Likes

ok, that is what i thought, but thanks much for the confirm.

@KianNH,

to clarify more, according to the R2 docs, r2 does NOT support X-Amz-Acl,
is that correct?
image

however in practice, r2 will accept X-Amz-Acl: private and then ignore it?
is that because most s3 clients PUT X-Amz-Acl: private and r2 wants to be compatible?

thanks much,
david

Yep.

I’m not too familiar with the decision, but if that’s the case then I’d say it’s likely.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.