Sha256: 6e76eacb61087986abc28dd9ae36442339310ba53f3d2a20b3c3a94ccc5aeeae

Contents?: true

Size: 804 Bytes

Versions: 7

Compression:

Stored size: 804 Bytes

Contents

# frozen_string_literal: true

unless HTTP::Client.instance_methods.include?(:build_request)
  # Backport of https://github.com/httprb/http/pull/458 for HTTP v3
  class HTTP::Client
    def build_request(verb, uri, opts = {})
      opts    = @default_options.merge(opts)
      uri     = make_request_uri(uri, opts)
      headers = make_request_headers(opts)
      body    = make_request_body(opts, headers)
      proxy   = opts.proxy

      HTTP::Request.new(
        verb: verb,
        uri: uri,
        headers: headers,
        proxy: proxy,
        body: body,
        auto_deflate: opts.feature(:auto_deflate),
      )
    end
  end
end

unless HTTP::Request::Body.instance_methods.include?(:source)
  # Backport for HTTP v3
  class HTTP::Request::Body
    def source
      @body
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ezclient-0.15.3 lib/ezclient/http_patch.rb
ezclient-0.15.2 lib/ezclient/http_patch.rb
ezclient-0.15.1 lib/ezclient/http_patch.rb
ezclient-0.15.0 lib/ezclient/http_patch.rb
ezclient-0.14.0 lib/ezclient/http_patch.rb
ezclient-0.13.1 lib/ezclient/http_patch.rb
ezclient-0.13.0 lib/ezclient/http_patch.rb