Fixed token parse error

This commit is contained in:
Shawn Niederriter 2017-03-01 08:43:39 +00:00
parent b87dc37fbb
commit 96503e274e

View File

@ -39,7 +39,7 @@ class Request(dict):
'app', 'url', 'headers', 'version', 'method', '_cookies', 'transport', 'app', 'url', 'headers', 'version', 'method', '_cookies', 'transport',
'query_string', 'body', 'query_string', 'body',
'parsed_json', 'parsed_args', 'parsed_form', 'parsed_files', 'parsed_json', 'parsed_args', 'parsed_form', 'parsed_files',
'_ip', '_ip','_token'
) )
def __init__(self, url_bytes, headers, version, method, transport): def __init__(self, url_bytes, headers, version, method, transport):
@ -79,10 +79,9 @@ class Request(dict):
:return: token related to request :return: token related to request
""" """
auth_header = self.headers.get('Authorization') if not hasattr(self, '_token'):
if auth_header is not None: self._token = self.headers.get('Authorization')
return auth_header.split()[1] return self._token
return auth_header
@property @property
def form(self): def form(self):