[tor-commits] [ooni-probe/master] Add extra checks in the body and header comparisons

art at torproject.org art at torproject.org
Tue Aug 19 08:00:15 UTC 2014


commit 981329235f9b8e8629d993e63e1215dd94e4e0d7
Author: Arturo Filastò <art at fuffa.org>
Date:   Mon Aug 18 16:49:54 2014 +0200

    Add extra checks in the body and header comparisons
---
 ooni/nettests/blocking/http_requests.py |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/ooni/nettests/blocking/http_requests.py b/ooni/nettests/blocking/http_requests.py
index 625f34c..d37489e 100644
--- a/ooni/nettests/blocking/http_requests.py
+++ b/ooni/nettests/blocking/http_requests.py
@@ -131,8 +131,10 @@ class HTTPRequestsTest(httpt.HTTPTest):
                     control = measurement.result
 
         if experiment and control:
-            self.compare_body_lengths(len(control.body),
-                                      len(experiment.body))
-            self.compare_headers(control.headers,
-                                 experiment.headers)
+            if experiment.body and control.body:
+                self.compare_body_lengths(len(control.body),
+                                        len(experiment.body))
+            if experiment.headers and control.headers:
+                self.compare_headers(control.headers,
+                                    experiment.headers)
         return self.report





More information about the tor-commits mailing list