Commit 870f1048 by Tom Christie

Fix incorrect 401 vs 403 response, if lazy authentication has not taken place.

parent 29136ef2
...@@ -88,7 +88,6 @@ class Request(object): ...@@ -88,7 +88,6 @@ class Request(object):
self._method = Empty self._method = Empty
self._content_type = Empty self._content_type = Empty
self._stream = Empty self._stream = Empty
self._authenticator = None
if self.parser_context is None: if self.parser_context is None:
self.parser_context = {} self.parser_context = {}
...@@ -206,6 +205,8 @@ class Request(object): ...@@ -206,6 +205,8 @@ class Request(object):
Return the instance of the authentication instance class that was used Return the instance of the authentication instance class that was used
to authenticate the request, or `None`. to authenticate the request, or `None`.
""" """
if not hasattr(self, '_authenticator'):
self._authenticator, self._user, self._auth = self._authenticate()
return self._authenticator return self._authenticator
def _load_data_and_files(self): def _load_data_and_files(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment