mirror of
https://github.com/lostisland/faraday.git
synced 2025-11-28 00:03:35 -05:00
enforce Proxy#uri to be a URI
This commit is contained in:
parent
b2eded6f1c
commit
fa58f794c5
@ -56,16 +56,16 @@ module Faraday
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class RequestOptions < Options.new(:params_encoder, :oauth, :bind,
|
class RequestOptions < Options.new(:params_encoder, :proxy, :bind,
|
||||||
:timeout, :open_timeout, :boundary,
|
:timeout, :open_timeout, :boundary,
|
||||||
:custom, :proxy)
|
:custom, :oauth)
|
||||||
|
|
||||||
def params_encoder
|
def params_encoder
|
||||||
self[:params_encoder] ||= NestedParamsEncoder
|
self[:params_encoder] ||= NestedParamsEncoder
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class SSLOptions < Options.new(:verify, :ca_file, :ca_path,
|
class SSLOptions < Options.new(:verify, :ca_file, :ca_path, :verify_mode,
|
||||||
:cert_store, :client_cert, :client_key, :verify_depth, :version)
|
:cert_store, :client_cert, :client_key, :verify_depth, :version)
|
||||||
|
|
||||||
def verify?
|
def verify?
|
||||||
@ -85,14 +85,11 @@ module Faraday
|
|||||||
case value
|
case value
|
||||||
when String then value = {:uri => Connection.URI(value)}
|
when String then value = {:uri => Connection.URI(value)}
|
||||||
when URI then value = {:uri => value}
|
when URI then value = {:uri => value}
|
||||||
|
when Hash, Options then value[:uri] = Connection.URI(value[:uri])
|
||||||
end
|
end
|
||||||
super(value)
|
super(value)
|
||||||
end
|
end
|
||||||
|
|
||||||
def uri
|
|
||||||
@uri ||= Connection.URI(self[:uri])
|
|
||||||
end
|
|
||||||
|
|
||||||
def user
|
def user
|
||||||
self[:user] ||= Utils.unescape(uri.user)
|
self[:user] ||= Utils.unescape(uri.user)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user