[tor-commits] [ooni-probe/master] Add inputProcessor to http_host

art at torproject.org art at torproject.org
Wed May 15 14:42:00 UTC 2013


commit 57a300305cd569f444d641cf1b25237e1e4b9be9
Author: aagbsn <aagbsn at extc.org>
Date:   Fri May 3 14:28:25 2013 +0800

    Add inputProcessor to http_host
---
 nettests/manipulation/http_host.py |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/nettests/manipulation/http_host.py b/nettests/manipulation/http_host.py
index d95d836..3f1e0c6 100644
--- a/nettests/manipulation/http_host.py
+++ b/nettests/manipulation/http_host.py
@@ -139,3 +139,13 @@ class HTTPHost(httpt.HTTPTest):
             self.report['transparent_http_proxy'] = True
             self.check_for_censorship(body)
 
+    def inputProcessor(self, filename=None):
+        """
+        This inputProcessor extracts domain names from urls
+        """
+        if filename:
+            fp = open(filename)
+            for x in fp.readlines():
+                yield x.strip().split('//')[-1].split('/')[0]
+            fp.close()
+        else: pass





More information about the tor-commits mailing list