Browse files

Don't raise exception when the bucket already exists. S3 doesn't do that

either.
  • Loading branch information...
1 parent 395eac6 commit 1c44cca4bb11acd800043eff913e64bbdce87942 @pneff pneff committed with Jun 15, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/parkplace/s3.rb
View
2 lib/parkplace/s3.rb
@@ -29,7 +29,7 @@ def put(bucket_name)
bucket = Bucket.find_root(bucket_name)
only_owner_of bucket
bucket.grant(requested_acl)
- raise BucketAlreadyExists
+ r(200, '', 'Location' => @env.PATH_INFO, 'Content-Length' => 0)
rescue NoSuchBucket
Bucket.create(:name => bucket_name, :owner_id => @user.id).grant(requested_acl)
r(200, '', 'Location' => @env.PATH_INFO, 'Content-Length' => 0)

0 comments on commit 1c44cca

Please sign in to comment.