[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Fix regexp for validating collector address
commit 6366721d21b09df38c33e65e42acd81c97598e19
Author: Arturo Filastò <art@xxxxxxxxx>
Date: Fri Jan 18 00:24:59 2013 +0100
Fix regexp for validating collector address
---
ooni/reporter.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ooni/reporter.py b/ooni/reporter.py
index c9fb61d..b01c99e 100644
--- a/ooni/reporter.py
+++ b/ooni/reporter.py
@@ -249,8 +249,8 @@ class OONIBReporter(OReporter):
Will raise :class:ooni.errors.InvalidOONIBCollectorAddress an exception
if the oonib reporter is not valid.
"""
- regexp = re.compile('^(http|httpo):\/\/\w+(:\d+)?$')
- if not regexp.match(self.collectorAddress):
+ regexp = '^(http|httpo):\/\/[a-zA-Z0-9\-\.]+(:\d+)?$'
+ if not re.match(regexp, self.collectorAddress):
raise InvalidOONIBCollectorAddress
@defer.inlineCallbacks
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits