Sha256: 17f6bc30b7475d4ba36ccff0445978eb30c9951fbbbf120157dc11c4bf0e76d3

Contents?: true

Size: 693 Bytes

Versions: 2

Compression:

Stored size: 693 Bytes

Contents

module Watir
  class HttpClient < Selenium::WebDriver::Remote::Http::Default
    # TODO: Remove for Watir 7; :client_timeout will be marked deprecated in 6.19
    # :open_timeout should have been changed in Selenium a while back, is in 4.beta2
    def initialize(open_timeout: nil, read_timeout: nil, client_timeout: nil)
      read_timeout ||= client_timeout
      open_timeout ||= client_timeout || 60
      super(open_timeout: open_timeout, read_timeout: read_timeout)
    end

    def request(verb, url, headers, payload, redirects = 0)
      headers['User-Agent'] = "#{headers['User-Agent']} watir/#{Watir::VERSION}"

      super(verb, url, headers, payload, redirects)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
watir-6.19.1 lib/watir/http_client.rb
watir-6.19.0 lib/watir/http_client.rb