Sha256: 819c4dc96ce1d2699c81b600d52ca2691538d247b62378528f3ccb65682132b2
Contents?: true
Size: 969 Bytes
Versions: 15
Compression:
Stored size: 969 Bytes
Contents
require 'httpclient' module Geminabox class HttpClientAdapter < HttpAdapter def get(*args) http_client.get(*args) end def get_content(*args) http_client.get_content(*args) end def post(*args) http_client.post(*args) end def set_auth(url, username = nil, password = nil) http_client.set_auth(url, username, password) if username or password http_client.www_auth.basic_auth.challenge(url) # Workaround: https://github.com/nahi/httpclient/issues/63 end def http_client @http_client ||= HTTPClient.new(ENV['http_proxy']).tap do |http_client| http_client.transparent_gzip_decompression = true http_client.keep_alive_timeout = 32 # sec http_client.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE http_client.send_timeout = 0 http_client.receive_timeout = 0 end end def http_client=(client) @http_client = client end end end
Version data entries
15 entries across 15 versions & 1 rubygems