Fix logic issue when processing HTTP requests

GSoC/Meterpreter_Web_Console
James Barnett 2018-07-28 15:23:56 -05:00
parent 37706e094d
commit 9e08bf6ec2
No known key found for this signature in database
GPG Key ID: 647983861A4EC5EA
1 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ module ResponseDataHelper
def json_to_hash(response_wrapper) def json_to_hash(response_wrapper)
begin begin
body = process_response(response_wrapper) body = process_response(response_wrapper)
if !body.nil? || !body.empty? if !body.nil? && !body.empty?
parsed_body = JSON.parse(body, symbolize_names: true) parsed_body = JSON.parse(body, symbolize_names: true)
return parsed_body[:data] return parsed_body[:data]
end end
@ -48,7 +48,7 @@ module ResponseDataHelper
if response_wrapper.expected if response_wrapper.expected
begin begin
body = process_response(response_wrapper) body = process_response(response_wrapper)
if !body.nil? || !body.empty? if !body.nil? && !body.empty?
parsed_body = JSON.parse(body).symbolize_keys parsed_body = JSON.parse(body).symbolize_keys
data = Array.wrap(parsed_body[:data]) data = Array.wrap(parsed_body[:data])
rv = [] rv = []