mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 13:14:30 +03:00
type('') to str
This commit is contained in:
parent
3d3b06447f
commit
c22b92a66c
|
@ -19,7 +19,7 @@ def get_authorization_header(request):
|
|||
Hide some test client ickyness where the header can be unicode.
|
||||
"""
|
||||
auth = request.META.get('HTTP_AUTHORIZATION', b'')
|
||||
if isinstance(auth, type('')):
|
||||
if isinstance(auth, str):
|
||||
# Work around django test client oddness
|
||||
auth = auth.encode(HTTP_HEADER_ENCODING)
|
||||
return auth
|
||||
|
|
Loading…
Reference in New Issue
Block a user