Skip to content

Commit

Permalink
Use isinstance() instead of type() for auth header
Browse files Browse the repository at this point in the history
(cherry picked from commit daa1e3e)
  • Loading branch information
tobias-urdin authored and mergify-bot committed Jun 30, 2021
1 parent 4b7ac05 commit c1e6bb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gnocchi/rest/auth_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class BasicAuthHelper(object):
@staticmethod
def get_current_user(request):
hdr = request.headers.get("Authorization")
auth_hdr = (hdr.decode('utf-8') if type(hdr) == bytes
auth_hdr = (hdr.decode('utf-8') if isinstance(hdr, bytes)
else hdr)
auth = werkzeug.http.parse_authorization_header(auth_hdr)
if auth is None:
Expand Down

0 comments on commit c1e6bb5

Please sign in to comment.