lib/async/http/client.rb in async-http-0.17.1 vs lib/async/http/client.rb in async-http-0.18.0
- old
+ new
@@ -55,20 +55,20 @@
end
VERBS = ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE']
VERBS.each do |verb|
- define_method(verb.downcase) do |*args, &block|
- self.request(verb, *args, &block)
+ define_method(verb.downcase) do |reference, *args, &block|
+ self.request(verb, reference.to_str, *args, &block)
end
end
def request(*args, &block)
@connections.acquire do |connection|
response = connection.send_request(@authority, *args)
begin
- yield response if block_given?
+ return yield response if block_given?
ensure
# This forces the stream to complete reading.
response.finish
end