Fix logic issue when processing HTTP requests
parent
37706e094d
commit
9e08bf6ec2
|
@ -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 = []
|
||||||
|
|
Loading…
Reference in New Issue