commit 32c463b766476a0db697d8c72264ed5683563fd2 Author: Arturo Filastò arturo@filasto.net Date: Sun May 8 19:08:52 2016 +0200
Add the redirected responses in inverted order
This means the first item in the list will be the final response, while the last will be the first response. --- ooni/templates/httpt.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/ooni/templates/httpt.py b/ooni/templates/httpt.py index 6b4c4b9..c58daf2 100644 --- a/ooni/templates/httpt.py +++ b/ooni/templates/httpt.py @@ -162,11 +162,6 @@ class HTTPTest(NetTestCase):
failure (instance): An instance of :class:twisted.internet.failure.Failure """ - if response and response.previousResponse: - self.addToReport(request, response.previousResponse, - response_body=None, - failure_string=None) - log.debug("Adding %s to report" % request) request_headers = TrueHeaders(request['headers']) session = { @@ -199,6 +194,12 @@ class HTTPTest(NetTestCase):
self.report['requests'].append(session)
+ if response and response.previousResponse: + self.addToReport(request, response.previousResponse, + response_body=None, + failure_string=None) + + def _processResponseBody(self, response_body, request, response, body_processor): log.debug("Processing response body") HTTPTest.addToReport(self, request, response, response_body)
tor-commits@lists.torproject.org