def create_bucket(bucket, headers={})
data = nil
unless Aws::Utils.blank?(headers[:location])
location = headers[:location].to_s
location.upcase! if location == 'eu'
data = "<CreateBucketConfiguration><LocationConstraint>#{location}</LocationConstraint></CreateBucketConfiguration>"
end
req_hash = generate_rest_request('PUT', headers.merge(:url=>bucket, :data => data))
request_info(req_hash, RightHttp2xxParser.new)
rescue Exception => e
e.is_a?(Aws::AwsError) && e.message.include?('BucketAlreadyOwnedByYou') ? true : on_exception
end