From 9b7228ec849e311bcb4007ad3e23cf2f1e54a721 Mon Sep 17 00:00:00 2001 From: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com> Date: Wed, 6 May 2020 17:11:01 -0700 Subject: [PATCH] fix: support string type response.data (#504) --- google/auth/impersonated_credentials.py | 1 + 1 file changed, 1 insertion(+) diff --git a/google/auth/impersonated_credentials.py b/google/auth/impersonated_credentials.py index c2351e7f7..84df484a4 100644 --- a/google/auth/impersonated_credentials.py +++ b/google/auth/impersonated_credentials.py @@ -88,6 +88,7 @@ def _make_iam_token_request(request, principal, headers, body): response = request(url=iam_endpoint, method="POST", headers=headers, body=body) + # support both string and bytes type response.data response_body = ( response.data.decode("utf-8") if hasattr(response.data, "decode")