summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Sevilla <devin.sevilla@rd.io>2014-05-09 12:02:37 -0700
committerDevin Sevilla <devin.sevilla@rd.io>2014-05-09 12:02:37 -0700
commit196450140fcff0692eb9c31e85f79df017ff2316 (patch)
tree830e2836d57242711da0e548f5ba692cd9e84e8f
parent45d7967ff0630de1c88e2de12fd59fde40eb0dec (diff)
downloadoauthlib-196450140fcff0692eb9c31e85f79df017ff2316.tar.gz
Use a more specific env variable for insecure transports
-rw-r--r--oauthlib/oauth2/rfc6749/utils.py2
-rw-r--r--tests/oauth2/rfc6749/test_utils.py8
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'),