try-except auth_header

This commit is contained in:
adamscmRH
2018-06-21 16:29:40 -04:00
parent 01a1d6ffd0
commit b7f5161835
2 changed files with 16 additions and 16 deletions

View File

@@ -234,8 +234,11 @@ class APIView(views.APIView):
was attempted.
"""
for authenticator in self.get_authenticators():
resp_hdr = authenticator.authenticate_header(request)
if not resp_hdr:
try:
resp_hdr = authenticator.authenticate_header(request)
if not resp_hdr:
continue
except AttributeError:
continue
req_hdr = get_authorization_header(request)
if not req_hdr: