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['raw_headers'] = opts['raw_headers'] || config['raw_headers'] || ''
opts['version'] = opts['version'] || config['version'] || '1.1' opts['version'] = opts['version'] || config['version'] || '1.1'
opts['client_config'] = self.config
if opts['basic_auth'] and not opts['authorization'] if opts['basic_auth'] and not opts['authorization']
opts['authorization'] = Rex::Text.encode_base64(opts['basic_auth']) opts['authorization'] = Rex::Text.encode_base64(opts['basic_auth'])
end end
req = ClientRequest.new(self.config,opts) req = ClientRequest.new(opts)
end end
@ -226,6 +228,8 @@ class Client
opts['raw_headers'] = opts['raw_headers'] || config['raw_headers'] || '' opts['raw_headers'] = opts['raw_headers'] || config['raw_headers'] || ''
opts['version'] = opts['version'] || config['version'] || '1.1' opts['version'] = opts['version'] || config['version'] || '1.1'
opts['client_config'] = self.config
if opts['encode_params'] == true or opts['encode_params'].nil? if opts['encode_params'] == true or opts['encode_params'].nil?
opts['encode_params'] = true opts['encode_params'] = true
else else
@ -236,7 +240,7 @@ class Client
opts['authorization'] = Rex::Text.encode_base64(opts['basic_auth']) opts['authorization'] = Rex::Text.encode_base64(opts['basic_auth'])
end end
req = ClientRequest.new(self.config,opts) req = ClientRequest.new(opts)
end end
# #

View File

@ -34,9 +34,9 @@ class ClientRequest
attr_reader :opts attr_reader :opts
def initialize(client_config,opts={}) def initialize(opts={})
@cgi = opts['cgi'] @cgi = opts['cgi']
@config = client_config @config = opts['client_config']
@connection = opts['connection'] @connection = opts['connection']
@content_type = opts['ctype'] @content_type = opts['ctype']
@cookie = opts['cookie'] @cookie = opts['cookie']