[tor-commits] [oonib/master] Add $ to the end of regexps that should have it
art at torproject.org
art at torproject.org
Wed Apr 23 14:31:51 UTC 2014
commit 0e7fb5824badb2e469a291fc9f1247ae31b51f01
Author: Taylor Hornby <havoc at defuse.ca>
Date: Thu Mar 27 14:30:26 2014 -0600
Add $ to the end of regexps that should have it
---
bin/archive_oonib_reports | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/archive_oonib_reports b/bin/archive_oonib_reports
index 3c238af..7d5ecfd 100755
--- a/bin/archive_oonib_reports
+++ b/bin/archive_oonib_reports
@@ -50,13 +50,13 @@ def validate_fields(fields):
# or not we should support > 2 character CC
if fields['probe_cc'] is None:
fields['probe_cc'] = default_probe_cc
- if not re.match('[A-Z\?]{2,4}', fields['probe_cc'].upper()):
+ if not re.match('[A-Z\?]{2,4}$', fields['probe_cc'].upper()):
raise InvalidReportField('probe_cc')
# check report ASN
if fields['probe_asn'] is None:
fields['probe_asn'] = 'AS0'
- if not re.match('^AS[0-9]{1,10}', fields['probe_asn'].upper()):
+ if not re.match('^AS[0-9]{1,10}$', fields['probe_asn'].upper()):
raise InvalidReportField('probe_asn')
# check report timestamp
More information about the tor-commits
mailing list