resolve_redirects now checks for a scheme before converting the scheme to lowercase, added tests or the scheme casing

This commit is contained in:
Bob Carroll
2013-04-30 23:17:18 -07:00
parent e715d7184b
commit 72e155e529
2 changed files with 11 additions and 2 deletions
+8
View File
@@ -495,6 +495,9 @@ class RequestsTestCase(unittest.TestCase):
headers['ACCEPT'.encode('ascii')],
'application/json'
)
def test_uppercase_scheme(self):
r = requests.get('HTTP://example.com/')
self.assertEqual(r.status_code, 200)
def test_transport_adapter_ordering(self):
s = requests.Session()
@@ -702,5 +705,10 @@ class TestCaseInsensitiveDict(unittest.TestCase):
self.assertEqual(frozenset(cid), keyset)
def test_uppercase_scheme_redirect(self):
r = requests.get(httpbin('redirect-to'), params={'url': 'HTTP://example.com/'})
if __name__ == '__main__':
unittest.main()