diff options
-rw-r--r-- | oauthlib/oauth2/rfc6749/utils.py | 2 | ||||
-rw-r--r-- | tests/oauth2/rfc6749/test_utils.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/oauthlib/oauth2/rfc6749/utils.py b/oauthlib/oauth2/rfc6749/utils.py index b2e12e1..67f8473 100644 --- a/oauthlib/oauth2/rfc6749/utils.py +++ b/oauthlib/oauth2/rfc6749/utils.py @@ -86,6 +86,6 @@ def generate_age(issue_time): def is_secure_transport(uri): """Check if the uri is over ssl.""" - if os.environ.get('DEBUG'): + if os.environ.get('OAUTHLIB_INSECURE_REDIRECTS'): return True return uri.lower().startswith('https://') diff --git a/tests/oauth2/rfc6749/test_utils.py b/tests/oauth2/rfc6749/test_utils.py index 1e59c8e..f15bbc3 100644 --- a/tests/oauth2/rfc6749/test_utils.py +++ b/tests/oauth2/rfc6749/test_utils.py @@ -48,15 +48,15 @@ class UtilsTests(TestCase): def test_is_secure_transport(self): """Test check secure uri.""" - if 'DEBUG' in os.environ: - del os.environ['DEBUG'] + if 'OAUTHLIB_INSECURE_TRANSPORT' in os.environ: + del os.environ['OAUTHLIB_INSECURE_TRANSPORT'] self.assertTrue(is_secure_transport('https://example.com')) self.assertFalse(is_secure_transport('http://example.com')) - os.environ['DEBUG'] = '1' + os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' self.assertTrue(is_secure_transport('http://example.com')) - del os.environ['DEBUG'] + del os.environ['OAUTHLIB_INSECURE_TRANSPORT'] def test_params_from_uri(self): self.assertEqual(params_from_uri('http://i.b/?foo=bar&g&scope=a+d'), |