mirror of
https://github.com/lostisland/faraday.git
synced 2025-12-11 00:04:41 -05:00
chore: RuboCop lint Naming/MemoizedInstanceVariableName
This commit is contained in:
parent
9e25ee6adc
commit
2fa4043f21
@ -121,13 +121,11 @@ module Faraday
|
|||||||
return ssl[:cert_store] if ssl[:cert_store]
|
return ssl[:cert_store] if ssl[:cert_store]
|
||||||
|
|
||||||
# Memoize the cert store so that the same one is passed to
|
# Memoize the cert store so that the same one is passed to
|
||||||
# HTTPClient each time, to avoid resyncing SSL sesions when
|
# HTTPClient each time, to avoid resyncing SSL sessions when
|
||||||
# it's changed
|
# it's changed
|
||||||
@cert_store ||= begin
|
@ssl_cert_store ||= begin
|
||||||
# Use the default cert store by default, i.e. system ca certs
|
# Use the default cert store by default, i.e. system ca certs
|
||||||
cert_store = OpenSSL::X509::Store.new
|
OpenSSL::X509::Store.new.tap(&:set_default_paths)
|
||||||
cert_store.set_default_paths
|
|
||||||
cert_store
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ module Faraday
|
|||||||
NET_HTTP_EXCEPTIONS << Net::OpenTimeout if defined?(Net::OpenTimeout)
|
NET_HTTP_EXCEPTIONS << Net::OpenTimeout if defined?(Net::OpenTimeout)
|
||||||
|
|
||||||
def initialize(app = nil, opts = {}, &block)
|
def initialize(app = nil, opts = {}, &block)
|
||||||
@cert_store = nil
|
@ssl_cert_store = nil
|
||||||
super(app, opts, &block)
|
super(app, opts, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -168,12 +168,11 @@ module Faraday
|
|||||||
|
|
||||||
def ssl_cert_store(ssl)
|
def ssl_cert_store(ssl)
|
||||||
return ssl[:cert_store] if ssl[:cert_store]
|
return ssl[:cert_store] if ssl[:cert_store]
|
||||||
return @cert_store if @cert_store
|
|
||||||
|
|
||||||
|
@ssl_cert_store ||= begin
|
||||||
# Use the default cert store by default, i.e. system ca certs
|
# Use the default cert store by default, i.e. system ca certs
|
||||||
@cert_store = OpenSSL::X509::Store.new
|
OpenSSL::X509::Store.new.tap(&:set_default_paths)
|
||||||
@cert_store.set_default_paths
|
end
|
||||||
@cert_store
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def ssl_verify_mode(ssl)
|
def ssl_verify_mode(ssl)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user