# File lib/s3/s3_interface.rb, line 213
    def create_bucket(bucket, headers={})
      data = nil
      unless headers[:location].blank?
#                data = "<CreateBucketConfiguration><LocationConstraint>#{headers[:location].to_s.upcase}</LocationConstraint></CreateBucketConfiguration>"
        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
      # if the bucket exists AWS returns an error for the location constraint interface. Drop it
      e.is_a?(Aws::AwsError) && e.message.include?('BucketAlreadyOwnedByYou') ? true : on_exception
    end