merge client config into opts
parent
de4234f0ad
commit
dac1147473
|
@ -186,11 +186,13 @@ class Client
|
|||
opts['raw_headers'] = opts['raw_headers'] || config['raw_headers'] || ''
|
||||
opts['version'] = opts['version'] || config['version'] || '1.1'
|
||||
|
||||
opts['client_config'] = self.config
|
||||
|
||||
if opts['basic_auth'] and not opts['authorization']
|
||||
opts['authorization'] = Rex::Text.encode_base64(opts['basic_auth'])
|
||||
end
|
||||
|
||||
req = ClientRequest.new(self.config,opts)
|
||||
req = ClientRequest.new(opts)
|
||||
end
|
||||
|
||||
|
||||
|
@ -226,6 +228,8 @@ class Client
|
|||
opts['raw_headers'] = opts['raw_headers'] || config['raw_headers'] || ''
|
||||
opts['version'] = opts['version'] || config['version'] || '1.1'
|
||||
|
||||
opts['client_config'] = self.config
|
||||
|
||||
if opts['encode_params'] == true or opts['encode_params'].nil?
|
||||
opts['encode_params'] = true
|
||||
else
|
||||
|
@ -236,7 +240,7 @@ class Client
|
|||
opts['authorization'] = Rex::Text.encode_base64(opts['basic_auth'])
|
||||
end
|
||||
|
||||
req = ClientRequest.new(self.config,opts)
|
||||
req = ClientRequest.new(opts)
|
||||
end
|
||||
|
||||
#
|
||||
|
|
|
@ -34,9 +34,9 @@ class ClientRequest
|
|||
|
||||
attr_reader :opts
|
||||
|
||||
def initialize(client_config,opts={})
|
||||
def initialize(opts={})
|
||||
@cgi = opts['cgi']
|
||||
@config = client_config
|
||||
@config = opts['client_config']
|
||||
@connection = opts['connection']
|
||||
@content_type = opts['ctype']
|
||||
@cookie = opts['cookie']
|
||||
|
|
Loading…
Reference in New Issue