commit dd58c40cb351b4d9d1b33fbef08919a8c225fad7 Merge: 1838533 a0fc5e6 Author: Simone Basso bassosimone@gmail.com Date: Mon Apr 4 17:58:05 2016 +0200
Merge branch 'master' into feature/json_reports
README.rst | 41 ++++++--------------------------- docs/source/tests/psiphon.rst | 4 ++-- ooni/nettest.py | 3 +++ ooni/nettests/manipulation/http_host.py | 2 -- ooni/tasks.py | 1 - ooni/templates/httpt.py | 4 +--- 6 files changed, 13 insertions(+), 42 deletions(-)
diff --cc ooni/templates/httpt.py index d2cc6e1,2f1136c..b9ca2e4 --- a/ooni/templates/httpt.py +++ b/ooni/templates/httpt.py @@@ -152,20 -134,14 +152,19 @@@ class HTTPTest(NetTestCase) } } if response: - request_response['response'] = { - 'headers': list(response.headers.getAllRawHeaders()), - 'body': response_body if self.localOptions.get('withoutbody', 0) == 0 else '', + if self.localOptions.get('withoutbody', 0) is 0: + response_body = _representBody(response_body) + else: + response_body = '' + session['response'] = { + 'headers': _representHeaders(response.headers), + 'body': response_body, 'code': response.code - } + } + session['failure'] = None if failure_string: - request_response['failure'] = failure_string - self.report['requests'].append(request_response) + session['failure'] = failure_string - + self.report['requests'].append(session)
def _processResponseBody(self, response_body, request, response, body_processor): log.debug("Processing response body")