Merge pull request #2278 from rooftopcellist/fix_dot_oauth2_error

Fix dot oauth2 error
This commit is contained in:
Christian Adams 2018-06-22 12:54:39 -04:00 committed by GitHub
commit 8bd2217a49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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: