plugin: pass block further, also request: do not convert to string, nonw that we'll have signatures

This commit is contained in:
HoneyryderChuck 2020-10-14 00:55:23 +01:00
parent 936a8533a7
commit 7c4ef3b12c
2 changed files with 3 additions and 3 deletions

View File

@ -34,11 +34,11 @@ module HTTPX
branch(default_options).wrap(&blk)
end
def plugin(*args, **opts)
def plugin(*args, **opts, &blk)
klass = is_a?(Session) ? self.class : Session
klass = Class.new(klass)
klass.instance_variable_set(:@default_options, klass.default_options.merge(default_options))
klass.plugin(*args, **opts).new
klass.plugin(*args, **opts, &blk).new
end
# deprecated

View File

@ -45,7 +45,7 @@ module HTTPX
def initialize(verb, uri, options = {})
@verb = verb.to_s.downcase.to_sym
@uri = URI(uri.to_s)
@uri = URI(uri)
@options = Options.new(options)
raise(Error, "unknown method: #{verb}") unless METHODS.include?(@verb)