Sha256: 04f3e1d67cf155f6139277f3003f745f11ec147a6d3b75155ab5089206c7a663
Contents?: true
Size: 788 Bytes
Versions: 10
Compression:
Stored size: 788 Bytes
Contents
module WWW class Mechanize class Chain class RequestResolver include WWW::Handler def handle(ctx, params) uri = params[:uri] if %w{ http https }.include?(uri.scheme.downcase) klass = Net::HTTP.const_get(params[:verb].to_s.capitalize) params[:request] ||= klass.new(uri.request_uri) end if %w{ file }.include?(uri.scheme.downcase) o = Struct.new(:uri).new(uri) class << o def add_field(*args); end alias :[]= :add_field def path uri.path end def each_header; end end params[:request] ||= o end super end end end end end
Version data entries
10 entries across 10 versions & 5 rubygems