Skip to content
Browse files

Updated the Bing API mixin to properly handle responses from the upda…

…ted API. Resolves #5.
  • Loading branch information...
lanmaster53 committed Sep 11, 2019
1 parent 6de6425 commit c986355816045b025fe8200b99818a4f2088d314
Showing with 2 additions and 1 deletion.
  1. +2 −1 recon/mixins/
@@ -94,7 +94,8 @@ def search_bing_api(self, query, limit=0):
raise framework.FrameworkException(f"Invalid JSON response.{os.linesep}{resp.text}")
#elif 'error' in resp.json():
elif resp.status_code == 401:
raise framework.FrameworkException(f"{resp.json()['statusCode']}: {resp.json()['message']}")
error = resp.json()['error']
raise framework.FrameworkException(f"({error['code']}) {error['message']}")
# add new results, or if there's no more, return what we have...
if 'webPages' in resp.json():

0 comments on commit c986355

Please sign in to comment.
You can’t perform that action at this time.