Sha256: 4149957c3d81d3377b8e9441f4e0826106780ed1d5a193fe39cfb18421252eb2
Contents?: true
Size: 675 Bytes
Versions: 8
Compression:
Stored size: 675 Bytes
Contents
# frozen_string_literal: true module Spandx module Gateways class Http attr_reader :driver def initialize(driver: Http.default_driver) @driver = driver end def get(uri, default: nil) driver.with_retry do |client| client.get(uri) end rescue *Net::Hippie::CONNECTION_ERRORS default end def ok?(response) response.is_a?(Net::HTTPSuccess) end def self.default_driver @default_driver ||= Net::Hippie::Client.new.tap do |client| client.logger = ::Logger.new('http.log') client.follow_redirects = 3 end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems