mirror of
https://github.com/rclone/rclone.git
synced 2025-01-11 08:49:37 +01:00
s3: fix detection of bucket existing
This reverts part of
151f03378f
s3: fix upload of single files into buckets without create permission
This erroneously assumed that a HEAD request on a non existent object
would return "NotFound" if the bucket was found. In fact it returns
"NotFound" when the bucket isn't found also.
This will break the fix for #4297 - however that can be made to work
using the new --s3-assume-bucket-exists flag
This commit is contained in:
parent
2bcc66c805
commit
801a820c54
@ -2446,11 +2446,6 @@ func (o *Object) readMetaData(ctx context.Context) (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
if awsErr, ok := err.(awserr.RequestFailure); ok {
|
if awsErr, ok := err.(awserr.RequestFailure); ok {
|
||||||
if awsErr.StatusCode() == http.StatusNotFound {
|
if awsErr.StatusCode() == http.StatusNotFound {
|
||||||
// NotFound indicates bucket was OK
|
|
||||||
// NoSuchBucket would be returned if bucket was bad
|
|
||||||
if awsErr.Code() == "NotFound" {
|
|
||||||
o.fs.cache.MarkOK(bucket)
|
|
||||||
}
|
|
||||||
return fs.ErrorObjectNotFound
|
return fs.ErrorObjectNotFound
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user