commit cd36a0d059b88810695a1b952ab54e853253f17e Author: Arturo Filastò arturo@filasto.net Date: Wed May 25 12:35:22 2016 +0200
Match status codes only when the control status code is not an error --- ooni/nettests/blocking/web_connectivity.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/ooni/nettests/blocking/web_connectivity.py b/ooni/nettests/blocking/web_connectivity.py index 8f048e1..7692d70 100644 --- a/ooni/nettests/blocking/web_connectivity.py +++ b/ooni/nettests/blocking/web_connectivity.py @@ -317,10 +317,11 @@ class WebConnectivityTest(httpt.HTTPTest, dnst.DNSTest): self.report['headers_match'] = \ self.compare_headers(experiment_http_response)
- self.report['status_code_match'] = ( - experiment_http_response.code == - self.control['http_request']['status_code'] - ) + if str(self.control['http_request']['status_code'])[0] != '5': + self.report['status_code_match'] = ( + self.control['http_request']['status_code'] == + experiment_http_response.code + )
self.report['title_match'] = self.compare_titles(experiment_http_response)
@@ -397,8 +398,8 @@ class WebConnectivityTest(httpt.HTTPTest, dnst.DNSTest): got_expected_web_page = ( (self.report['body_length_match'] is True or self.report['headers_match'] is True or - self.report['title_match']) - and self.report['status_code_match'] is True + self.report['title_match'] is True) + and self.report['status_code_match'] is not False )
if (dns_consistent == True and tcp_connect == False and