Skip to content

Commit

Permalink
Add support for testing via http when the site is https
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed May 31, 2017
1 parent 186a2b7 commit 3b500b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ooni/nettests/blocking/web_connectivity.py
Expand Up @@ -39,6 +39,7 @@ class UsageOptions(usage.Options):
]
optFlags = [
['no-shuffle', '', 'Disable shuffling of URLs'],
['no-http', '', 'Disable testing also http for https sites'],
]


Expand All @@ -52,7 +53,7 @@ class WebConnectivityTest(httpt.HTTPTest, dnst.DNSTest):
"connect to the resolved IPs and then fetching the page "
"and comparing all these results with those of a control.")
author = "Arturo Filastò"
version = "0.3.0"
version = "0.3.2"

contentDecoders = [('gzip', GzipDecoder)]

Expand Down Expand Up @@ -136,6 +137,8 @@ def simple_file_generator(fh):
if (not i.startswith("http://") and
not i.startswith("https://")):
i = "http://{}/".format(i)
if i.startswith('https://') and self.localOptions['no-http'] != True:
yield 'http'+i[5:]
yield i
finally:
fh.close()
Expand Down

0 comments on commit 3b500b8

Please sign in to comment.