Skip to content

Commit

Permalink
Remove coercion of AWS ip range response to text
Browse files Browse the repository at this point in the history
Our tests and mocked this network request to
return parsed json, but the actual implementation
was still fetching text. This fixes the exception we saw
  • Loading branch information
mrchrisadams committed Nov 15, 2023
1 parent 411dc0a commit 7ba542f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/greencheck/importers/importer_amazon.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def fetch_data_from_source(self) -> dict:
Fetch the data from the endpoint, returning the parsed json
"""
try:
response = requests.get(settings.AMAZON_REMOTE_API_ENDPOINT).text
response = requests.get(settings.AMAZON_REMOTE_API_ENDPOINT)
return response.json()
except requests.RequestException:
logger.warning("Unable to fetch ip data. Aborting early.")
Expand Down

0 comments on commit 7ba542f

Please sign in to comment.