    # File lib/fog/aws/requests/storage/put_object_acl.rb, line 33
            def put_object_acl(bucket_name, object_name, acl, options = {})
              query = {'acl' => nil}
              if version_id = options.delete('versionId')
                query['versionId'] = version_id
              end

              data = ""
              headers = {}

              if acl.is_a?(Hash)
                data = Fog::Storage::AWS.hash_to_acl(acl)
              else
                if !['private', 'public-read', 'public-read-write', 'authenticated-read'].include?(acl)
                  raise Excon::Errors::BadRequest.new('invalid x-amz-acl')
                end
                headers['x-amz-acl'] = acl
              end

              headers['Content-MD5'] = Base64.encode64(Digest::MD5.digest(data)).strip
              headers['Content-Type'] = 'application/json'
              headers['Date'] = Fog::Time.now.to_date_header

              request({
                :body     => data,
                :expects  => 200,
                :headers  => headers,
                :host     => "#{bucket_name}.#{@host}",
                :method   => 'PUT',
                :path       => CGI.escape(object_name),
                :query    => query
              })
            end