Fixing token parser error

This commit is contained in:
Shawn Niederriter 2017-04-17 14:38:24 +00:00
parent 7e9b65feca
commit f18e0b663d

View File

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