rclone/backend/s3
nielash 8470bdf810 s3: fix 405 error on HEAD for delete marker with versionId
When getting an object by specifying a versionId in the request, if the
specified version is a delete marker, it returns 405 (Method Not Allowed),
instead of 404 (Not Found) which would be returned without a versionId. See
https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeleteMarker.html

Before this change, we were only looking for 404 (and not 405) to determine
whether the object exists. This meant that in some circumstances (ex. when
Versioning is enabled for the bucket and we have a non-null X-Amz-Version-Id), we
deemed the object to exist when we should not have.

After this change, 405 (Method Not Allowed) is treated the same as 404 (Not
Found) for the purposes of headObject.

See https://forum.rclone.org/t/bisync-rename-failed-method-not-allowed/45723/13
2024-06-13 18:09:29 +01:00
..
gen_setfrom.go build: remove build constraint syntax for go 1.16 and older 2024-04-18 16:53:55 +02:00
s3_internal_test.go s3: fix no error being returned when creating a bucket we don't own 2023-10-09 18:15:02 +01:00
s3_test.go s3: S3 IPv6 support with option "use_dual_stack" (bool) 2023-12-08 11:11:47 +00:00
s3.go s3: fix 405 error on HEAD for delete marker with versionId 2024-06-13 18:09:29 +01:00
setfrom.go s3: support metadata setting and mapping on server side Copy 2024-03-07 14:44:45 +00:00
v2sign.go s3: v3sign: add missing subresource delete 2023-05-14 11:25:52 +01:00