We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3d3b064 + 09aa8f7 commit dd3b47cCopy full SHA for dd3b47c
rest_framework/authentication.py
@@ -7,6 +7,7 @@
7
8
from django.contrib.auth import authenticate, get_user_model
9
from django.middleware.csrf import CsrfViewMiddleware
10
+from django.utils.six import string_types
11
from django.utils.translation import ugettext_lazy as _
12
13
from rest_framework import HTTP_HEADER_ENCODING, exceptions
@@ -19,7 +20,7 @@ def get_authorization_header(request):
19
20
Hide some test client ickyness where the header can be unicode.
21
"""
22
auth = request.META.get('HTTP_AUTHORIZATION', b'')
- if isinstance(auth, type('')):
23
+ if isinstance(auth, string_types):
24
# Work around django test client oddness
25
auth = auth.encode(HTTP_HEADER_ENCODING)
26
return auth
0 commit comments