From 3004ad539875ffc2c9ec5a376af7203189ce6fe1 Mon Sep 17 00:00:00 2001 From: Viktor Haag Date: Fri, 24 May 2013 11:26:00 -0400 Subject: [PATCH] Lower-ify url before checking against prefix with startswith() --- requests/adapters.py | 2 +- requests/sessions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requests/adapters.py b/requests/adapters.py index 98b7317e..b4502796 100644 --- a/requests/adapters.py +++ b/requests/adapters.py @@ -118,7 +118,7 @@ class HTTPAdapter(BaseAdapter): :param verify: Whether we should actually verify the certificate. :param cert: The SSL certificate to verify. """ - if url.startswith('https') and verify: + if url.lower.startswith('https') and verify: cert_loc = None diff --git a/requests/sessions.py b/requests/sessions.py index f4aeeee6..ccd76340 100644 --- a/requests/sessions.py +++ b/requests/sessions.py @@ -467,7 +467,7 @@ class Session(SessionRedirectMixin): """Returns the appropriate connnection adapter for the given URL.""" for (prefix, adapter) in self.adapters.items(): - if url.startswith(prefix): + if url.lower.startswith(prefix): return adapter # Nothing matches :-/