lib/httpx/adapters/faraday.rb in httpx-1.3.0 vs lib/httpx/adapters/faraday.rb in httpx-1.3.1
- old
+ new
@@ -28,10 +28,11 @@
@connection = @connection.plugin(:proxy).with(proxy: proxy_options)
end
@connection = @connection.plugin(OnDataPlugin) if env.request.stream_response?
+ @connection = @config_block.call(@connection) || @connection if @config_block
@connection
end
def close
@connection.close if @connection
@@ -210,10 +211,10 @@
responses = session.request(*requests)
Array(responses).each_with_index do |response, index|
handler = @handlers[index]
handler.on_response.call(response)
- handler.on_complete.call(handler.env)
+ handler.on_complete.call(handler.env) if handler.on_complete
end
end
rescue ::HTTPX::TimeoutError => e
raise Faraday::TimeoutError, e
end