mozilla / stooge

Mozilla Stooge
Mozilla Public License 2.0
8 stars 6 forks source link

Exception in checks.final_response() #28

Closed st3fan closed 10 years ago

st3fan commented 10 years ago
[2014-05-22 15:51:05,648: ERROR/Worker-8] stooge.scanner.tasks.check_task[6d8bfe56-4c35-4cfc-aea1-86a6e7dbc329]: Error while executing checks
Traceback (most recent call last):
  File "/home/sarentz/stooge/stooge/scanner/tasks.py", line 125, in check_task
    results = execute_checks_against_responses(site)
  File "/home/sarentz/stooge/stooge/scanner/checks.py", line 132, in execute_checks_against_responses
    results["basic"].append({"name": check.__name__, "result": check(site, results, site["responses"]["http"], site["responses"]["https"])})
  File "/home/sarentz/stooge/stooge/scanner/checks.py", line 34, in xfo
    r = final_response(http_responses, https_responses)
  File "/home/sarentz/stooge/stooge/scanner/checks.py", line 14, in final_response
    return http_responses[-1]
IndexError: list index out of range
st3fan commented 10 years ago

I think this happens because we do not check if a site has an error or a non-200 response. In those cases there are likely no http responses, so those arrays are nil. Adding some more robust checking there to make sure we skip those.