mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-19 13:03:19 +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.
|
Hide some test client ickyness where the header can be unicode.
|
||||||
"""
|
"""
|
||||||
auth = request.META.get('HTTP_AUTHORIZATION', b'')
|
auth = request.META.get('HTTP_AUTHORIZATION', b'')
|
||||||
if isinstance(auth, type('')):
|
if isinstance(auth, str):
|
||||||
# Work around django test client oddness
|
# Work around django test client oddness
|
||||||
auth = auth.encode(HTTP_HEADER_ENCODING)
|
auth = auth.encode(HTTP_HEADER_ENCODING)
|
||||||
return auth
|
return auth
|
||||||
|
|
Loading…
Reference in New Issue
Block a user