Skip to content

Commit

Permalink
URLHeadBear.py: Change connection check URL
Browse files Browse the repository at this point in the history
Changed URL that checks if client is connected to the internet or not
from Google's IP address 216.58.218.174
to DNS IP owned by Cloudfare 1.1.1.1

Fixes coala#2833
  • Loading branch information
frextrite committed Jan 8, 2019
1 parent 2888639 commit 2884203
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bears/general/URLHeadBear.py
Expand Up @@ -69,8 +69,8 @@ class URLHeadBear(LocalBear):
LICENSE = 'AGPL-3.0'
CAN_DETECT = {'Documentation'}

# IP Address of www.google.com
check_connection_url = 'http://216.58.218.174'
# DNS IP by Cloudfare
check_connection_url = 'http://1.1.1.1/'

@classmethod
def check_prerequisites(cls):
Expand Down
3 changes: 2 additions & 1 deletion tests/general/URLHeadBearTest.py
Expand Up @@ -15,7 +15,8 @@ class URLHeadBearTestPrerequisites(unittest.TestCase):
def test_check_prerequisites(self):
with requests_mock.Mocker() as m:
m.add_matcher(custom_matcher)
self.assertEqual(URLHeadBear.check_prerequisites(),
self.assertTrue(URLHeadBear.check_prerequisites())
self.assertNotEqual(URLHeadBear.check_prerequisites(),
'You are not connected to the internet.')

m.head(URLHeadBear.check_connection_url,
Expand Down

0 comments on commit 2884203

Please sign in to comment.