Fixed support for "Bearer" and "Token" auth-schemes.
Removed the test for "Authentication: Bearer Token <TOKEN>" which was not supposed to exist (see https://github.com/channelcat/sanic/pull/821) Also added a call to `split` when retrieving the token value to handle cases where there are leading or trailing spaces.
This commit is contained in:
		| @@ -172,16 +172,6 @@ def test_token(): | ||||
|  | ||||
|     assert request.token == token | ||||
|  | ||||
|     token = 'a1d895e0-553a-421a-8e22-5ff8ecb48cbf' | ||||
|     headers = { | ||||
|         'content-type': 'application/json', | ||||
|         'Authorization': 'Bearer Token {}'.format(token) | ||||
|     } | ||||
|  | ||||
|     request, response = app.test_client.get('/', headers=headers) | ||||
|  | ||||
|     assert request.token == token | ||||
|      | ||||
|     token = 'a1d895e0-553a-421a-8e22-5ff8ecb48cbf' | ||||
|     headers = { | ||||
|         'content-type': 'application/json', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 François KUBLER
					François KUBLER