Fix query array encoding issue
parent
67b7af3385
commit
dcf4171cfb
|
@ -108,7 +108,8 @@ class RemoteHTTPDataService
|
|||
#
|
||||
def make_request(request_type, path, data_hash = nil, query = nil)
|
||||
begin
|
||||
query_str = (!query.nil? && !query.empty?) ? URI.encode_www_form(append_workspace(query)) : nil
|
||||
# simplify query by removing nil values
|
||||
query_str = (!query.nil? && !query.empty?) ? append_workspace(query).compact.to_query : nil
|
||||
uri = URI::HTTP::build({path: path, query: query_str})
|
||||
puts "#{Time.now} - HTTP #{request_type} request to #{uri.request_uri} with #{data_hash ? data_hash : "nil"}"
|
||||
|
||||
|
|
|
@ -152,9 +152,9 @@ module Msf::DBManager::Host
|
|||
|
||||
conditions = {}
|
||||
conditions[:state] = [Msf::HostState::Alive, Msf::HostState::Unknown] if opts[:non_dead]
|
||||
conditions[:address] = opts[:addresses] if opts[:addresses]
|
||||
conditions[:address] = opts[:addresses] if opts[:addresses] && !opts[:addresses].empty?
|
||||
|
||||
if opts[:search_term]
|
||||
if opts[:search_term] && !opts[:search_term].empty?
|
||||
column_search_conditions = Msf::Util::DBManager.create_all_column_search_conditions(Mdm::Host, opts[:search_term])
|
||||
tag_conditions = Arel::Nodes::Regexp.new(Mdm::Tag.arel_table[:name], Arel::Nodes.build_quoted("(?mi)#{opts[:search_term]}"))
|
||||
search_conditions = column_search_conditions.or(tag_conditions)
|
||||
|
|
Loading…
Reference in New Issue