summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIb Lundgren <ib.lundgren@gmail.com>2013-07-09 17:52:00 +0100
committerIb Lundgren <ib.lundgren@gmail.com>2013-07-09 17:52:00 +0100
commit8f055a33055e6902c1ec004386a740ac6bea6885 (patch)
treed03634d1138d3fdca44fc41f15ba5798757fb23d
parent5a9d57dd5f179102ed95cbc75986f913bb6fb326 (diff)
downloadoauthlib-8f055a33055e6902c1ec004386a740ac6bea6885.tar.gz
Auth scheme lower and short header test.
-rw-r--r--oauthlib/oauth1/rfc5849/utils.py5
-rw-r--r--tests/oauth1/rfc5849/test_utils.py1
2 files changed, 3 insertions, 3 deletions
diff --git a/oauthlib/oauth1/rfc5849/utils.py b/oauthlib/oauth1/rfc5849/utils.py
index ecd1755..1b452e7 100644
--- a/oauthlib/oauth1/rfc5849/utils.py
+++ b/oauthlib/oauth1/rfc5849/utils.py
@@ -91,9 +91,8 @@ def parse_http_list(u):
def parse_authorization_header(authorization_header):
"""Parse an OAuth authorization header into a list of 2-tuples"""
- auth_scheme = 'OAuth '
- if authorization_header[:len(auth_scheme)].lower().startswith(
- auth_scheme.lower()):
+ auth_scheme = 'OAuth '.lower()
+ if authorization_header[:len(auth_scheme)].lower().startswith(auth_scheme):
items = parse_http_list(authorization_header[len(auth_scheme):])
try:
return list(parse_keqv_list(items).items())
diff --git a/tests/oauth1/rfc5849/test_utils.py b/tests/oauth1/rfc5849/test_utils.py
index 59ee744..41d1e2e 100644
--- a/tests/oauth1/rfc5849/test_utils.py
+++ b/tests/oauth1/rfc5849/test_utils.py
@@ -46,6 +46,7 @@ class UtilsTests(TestCase):
"OAuth",
"OAuth oauth_nonce=",
"Negotiate b2F1dGhsaWI=",
+ "OA",
)
def test_filter_params(self):