mirror of
https://github.com/lostisland/faraday.git
synced 2025-11-22 00:08:56 -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
|
||||
|
||||
class RequestOptions < Options.new(:params_encoder, :oauth, :bind,
|
||||
class RequestOptions < Options.new(:params_encoder, :proxy, :bind,
|
||||
:timeout, :open_timeout, :boundary,
|
||||
:custom, :proxy)
|
||||
:custom, :oauth)
|
||||
|
||||
def params_encoder
|
||||
self[:params_encoder] ||= NestedParamsEncoder
|
||||
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)
|
||||
|
||||
def verify?
|
||||
@ -85,14 +85,11 @@ module Faraday
|
||||
case value
|
||||
when String then value = {:uri => Connection.URI(value)}
|
||||
when URI then value = {:uri => value}
|
||||
when Hash, Options then value[:uri] = Connection.URI(value[:uri])
|
||||
end
|
||||
super(value)
|
||||
end
|
||||
|
||||
def uri
|
||||
@uri ||= Connection.URI(self[:uri])
|
||||
end
|
||||
|
||||
def user
|
||||
self[:user] ||= Utils.unescape(uri.user)
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user