diff --git a/functions/security/main.py b/functions/security/main.py index 397bb2404d7..0fd5c762187 100644 --- a/functions/security/main.py +++ b/functions/security/main.py @@ -32,11 +32,11 @@ def calling_function(request): # Fetch the token token_response = requests.get(token_full_url, headers=token_headers) - jwt = token_response.content + jwt = token_response.text # Provide the token in the request to the receiving function function_headers = {'Authorization': f'bearer {jwt}'} function_response = requests.get(function_url, headers=function_headers) - return function_response.content + return function_response.text # [END functions_bearer_token] diff --git a/functions/security/main_test.py b/functions/security/main_test.py index bf86eea01f0..b603547a3bd 100644 --- a/functions/security/main_test.py +++ b/functions/security/main_test.py @@ -19,8 +19,8 @@ class Response(object): - def __init__(self, content=u''): - self.content = content + def __init__(self, text=u''): + self.text = text @mock.patch("main.requests")