summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranay Suresh <psuresh@teslamotors.com>2016-04-07 17:15:33 -0700
committerPranay Suresh <psuresh@teslamotors.com>2016-04-07 17:15:33 -0700
commit8cb8cf769b5b502bcd31e3f40b8506df09125504 (patch)
treec8c61ec881ee1920574ea1549c0f60676d94b2a1
parent43de66aaa7b4b6bef385bb89877653b45b621a58 (diff)
downloadwebtest-8cb8cf769b5b502bcd31e3f40b8506df09125504.tar.gz
support bearer auth
-rw-r--r--webtest/app.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/webtest/app.py b/webtest/app.py
index 8110ed8..a0da8cf 100644
--- a/webtest/app.py
+++ b/webtest/app.py
@@ -204,6 +204,8 @@ class TestApp(object):
val = ':'.join(list(val))
val = b64encode(to_bytes(val)).strip()
val = val.decode('latin1')
+ elif authtype == 'Bearer' and val and isinstance(val, (str, unicode)):
+ val = val.strip()
else:
raise ValueError(invalid_value)
value = str('%s %s' % (authtype, val))