Sha256: 10362c429fa388f92985596d07ae300cbb65898b7cc15742f293cfa0fe280c97

Contents?: true

Size: 960 Bytes

Versions: 7

Compression:

Stored size: 960 Bytes

Contents

require 'typhoeus'

module Selenium
module WebDriver
module Remote

module Http

# The default client is unusably slow on platforms where Ruby IO is lacking in
# performance, like Windows.
class Typhoeus < Common

    private

    def request( verb, url, headers, payload )
        url = url.to_s

        headers.delete 'Content-Length'

        options = {
            headers:        headers,
            maxredirs:      MAX_REDIRECTS,
            followlocation: true
        }

        options[:timeout] = @timeout if @timeout

        case verb
            when :post, :put
                options[:body] = payload.to_s

            when :get, :delete, :head
            else
                raise Error::WebDriverError, "Unknown HTTP verb: #{verb.inspect}"
        end

        response = ::Typhoeus::Request.send( verb, url, options )
        create_response response.code, response.body, response.headers['Content-Type']
    end

end

end
end
end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
arachni-1.0.6 lib/arachni/selenium/webdriver/remote/http/typhoeus.rb
arachni-1.0.5 lib/arachni/selenium/webdriver/remote/http/typhoeus.rb
arachni-1.0.4 lib/arachni/selenium/webdriver/remote/http/typhoeus.rb
arachni-1.0.3 lib/arachni/selenium/webdriver/remote/http/typhoeus.rb
arachni-1.0.2 lib/arachni/selenium/webdriver/remote/http/typhoeus.rb
arachni-1.0.1 lib/arachni/selenium/webdriver/remote/http/typhoeus.rb
arachni-1.0 lib/arachni/selenium/webdriver/remote/http/typhoeus.rb