Added support for 'Authorization: Bearer <TOKEN>' header in Request.token property.

Also added a test case for that kind of header.
This commit is contained in:
François KUBLER
2017-06-22 18:11:23 +02:00
parent b5369e611c
commit 55f860da2f
2 changed files with 18 additions and 4 deletions

View File

@@ -180,6 +180,16 @@ def test_token():
request, response = app.test_client.get('/', headers=headers)
assert request.token == token
token = 'a1d895e0-553a-421a-8e22-5ff8ecb48cbf'
headers = {
'content-type': 'application/json',
'Authorization': 'Bearer {}'.format(token)
}
request, response = app.test_client.get('/', headers=headers)
assert request.token == token
# no Authorization headers