Setup Faraday middleware before adapter

This eliminate the warnings:

WARNING: Unexpected middleware set after the adapter. This won't be supported from Faraday 1.0.
This commit is contained in:
Lin Jen-Shin 2018-03-16 19:05:29 +08:00
parent a63d74709b
commit 31b0097be0

View file

@ -52,6 +52,8 @@ module ContainerRegistry
conn.request(:authorization, :bearer, options[:token].to_s) conn.request(:authorization, :bearer, options[:token].to_s)
end end
yield(conn) if block_given?
conn.adapter :net_http conn.adapter :net_http
end end
@ -80,8 +82,7 @@ module ContainerRegistry
def faraday def faraday
@faraday ||= Faraday.new(@base_uri) do |conn| @faraday ||= Faraday.new(@base_uri) do |conn|
initialize_connection(conn, @options) initialize_connection(conn, @options, &method(:accept_manifest))
accept_manifest(conn)
end end
end end