Add Adapter#close so that derived classes can call super. (#1091)

This commit is contained in:
Samuel Williams 2019-12-28 05:48:45 +13:00 committed by Mattia
parent a53a4360e2
commit 15595d0370

View File

@ -60,6 +60,13 @@ module Faraday
yield conn
end
# Close any persistent connections. The adapter should still be usable
# after calling close.
def close
# Possible implementation:
# @app.close if @app.respond_to?(:close)
end
def call(env)
env.clear_body if env.needs_body?
env.response = Response.new