Skip to content

Commit

Permalink
Merge pull request #851 from lukaszrzasik/issue-850-otxquery-fix
Browse files Browse the repository at this point in the history
Use Response.text instead of Response.content
  • Loading branch information
dadokkio authored Sep 15, 2020
2 parents 69e2868 + 598248c commit dbb9bd1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions analyzers/OTXQuery/otxquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def otx_query_ip(self, data):
try:
for section in sections:
queryurl = baseurl + section
ip_[section] = json.loads(requests.get(queryurl, headers=headers).content)
ip_[section] = json.loads(requests.get(queryurl, headers=headers).text)

ip_general = ip_['general']
ip_geo = ip_['geo']
Expand Down Expand Up @@ -64,7 +64,7 @@ def otx_query_domain(self, data):
try:
for section in sections:
queryurl = baseurl + section
ip_[section] = json.loads(requests.get(queryurl, headers=headers).content)
ip_[section] = json.loads(requests.get(queryurl, headers=headers).text)

result = {
'pulse_count': ip_.get('general', {}).get('pulse_info', {}).get('count', "0"),
Expand Down Expand Up @@ -98,7 +98,7 @@ def otx_query_file(self, data):
try:
for section in sections:
queryurl = baseurl + section
ip_[section] = json.loads(requests.get(queryurl, headers=headers).content)
ip_[section] = json.loads(requests.get(queryurl, headers=headers).text)

if ip_['analysis']['analysis']:
# file has been analyzed before
Expand Down Expand Up @@ -142,7 +142,7 @@ def otx_query_url(self, data):
try:
for section in sections:
queryurl = baseurl + section
IP_[section] = json.loads(requests.get(queryurl, headers=headers).content)
IP_[section] = json.loads(requests.get(queryurl, headers=headers).text)

self.report({
'pulse_count': IP_.get('general', {}).get('pulse_info', {}).get('count', "0"),
Expand Down

0 comments on commit dbb9bd1

Please sign in to comment.