You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.
I'm encountered this when I tried to restrict access to the Swagger view to only staff members by mimicking get_swagger_view with permission_classes set to (IsAdminUser,) instead of (AllowAny). When I try to access this view while not logged in, I get an UnicodeDecodeError instead of the expected 401 response. I have my language set to Swedish so the response will contain non-ascii characters.
data={u'detail': u'Autentiseringsuppgifter ej tillhandah\xe5llna.'}
I'm encountered this when I tried to restrict access to the Swagger view to only staff members by mimicking
get_swagger_view
withpermission_classes
set to(IsAdminUser,)
instead of(AllowAny)
. When I try to access this view while not logged in, I get an UnicodeDecodeError instead of the expected 401 response. I have my language set to Swedish so the response will contain non-ascii characters.The UnicodeEncodeError happens at renderers.py#58.
It works fine for me when I change
at renderers.py#31 to
which it already does for the 200 OK case via the
OpenAPICodec
encode call.My setup:
django-rest-swagger: 2.2.0
djangorestframework: 3.7.7
Django: 1.11.17
Python 2.7
Language: sv_SE
The text was updated successfully, but these errors were encountered: