Skip to content

Commit

Permalink
Merge pull request #872 from karlcow/870/2
Browse files Browse the repository at this point in the history
Fix #870 -  json loads on empty body
  • Loading branch information
Mike Taylor committed Dec 16, 2015
2 parents d071251 + b429f5d commit 874b1ce
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions webcompat/api/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,10 @@ def get_issue_category(issue_category):
# api_request returns a tuple of format:
# (content, status_code, response_headers)
# So we make a dict here for improved readability
new_issues = {
'content': filter_new(json.loads(issues[0])),
'status_code': issues[1],
'response_headers': issues[2]
}
return (new_issues['content'], new_issues['status_code'],
new_issues['response_headers'])
content, status_code, response_headers = issues
if status_code != 304:
content = filter_new(json.loads(content))
return (content, status_code, response_headers)
else:
# The path doesn’t exist. 404 Not Found.
abort(404)
Expand Down

0 comments on commit 874b1ce

Please sign in to comment.