
commit 06072dd64fa6544b980a841c73179fd96f8c35e9 Author: Arturo Filastò <art@fuffa.org> Date: Fri Dec 7 02:30:39 2012 +0100 Set the default ASN to 0 * Should be good as per http://tools.ietf.org/html/draft-ietf-idr-as0-06 --- ooni/reporter.py | 2 +- oonib/report/file_collector.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/ooni/reporter.py b/ooni/reporter.py index 460b584..602b687 100644 --- a/ooni/reporter.py +++ b/ooni/reporter.py @@ -127,7 +127,7 @@ def getTestDetails(options): # Here we unset all the client geodata if the option to not include then # has been specified if client_geodata and not config.privacy.includeasn: - client_geodata['asn'] = None + client_geodata['asn'] = 'AS0' else: # XXX this regexp should probably go inside of geodata client_geodata['asn'] = \ diff --git a/oonib/report/file_collector.py b/oonib/report/file_collector.py index 636576b..6d5584c 100644 --- a/oonib/report/file_collector.py +++ b/oonib/report/file_collector.py @@ -56,6 +56,9 @@ def parseNewReportRequest(request): } parsed_request = json.loads(request) + if not parsed_request['probe_asn']: + parsed_request['probe_asn'] = 'AS0' + for k, regexp in expected_request.items(): try: value_to_check = parsed_request[k]