Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Response.text instead of Response.content #851

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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