merge client config into opts

bug/bundler_fix
David Maloney 2013-02-19 19:41:42 -06:00
parent de4234f0ad
commit dac1147473
2 changed files with 8 additions and 4 deletions

View File

@ -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
#

View File

@ -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']