[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [oonib/master] Apply the correct regular expression to the test helper key.



commit d4fe193e86f9982546b648da1432db132ae77f5f
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Thu Mar 27 22:13:57 2014 +0100

    Apply the correct regular expression to the test helper key.
    
    Fixes #37
---
 oonib/report/handlers.py |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/oonib/report/handlers.py b/oonib/report/handlers.py
index dea5326..9e9e8ca 100644
--- a/oonib/report/handlers.py
+++ b/oonib/report/handlers.py
@@ -99,6 +99,7 @@ def parseNewReportRequest(request):
     version_string = re.compile("[0-9A-Za-z_\-\.]+$")
     name = re.compile("[a-zA-Z0-9_\- ]+$")
     probe_asn = re.compile("AS[0-9]+$")
+    test_helper = re.compile("[A-Za-z0-9_\-]+$")
 
     expected_request = {
      'software_name': name,
@@ -125,8 +126,8 @@ def parseNewReportRequest(request):
             raise InvalidRequestField(k)
     
     try:
-        test_helper = parsed_request['test_helper']
-        if not re.match(regexp, str(test_helper)):
+        requested_test_helper = parsed_request['test_helper']
+        if not re.match(test_helper, str(requested_test_helper)):
             raise InvalidRequestField('test_helper')
     except KeyError:
         pass



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits