From 4948ebb3ca151e9f0433585a41bad6f415416b2d Mon Sep 17 00:00:00 2001 From: Bouke van der Bijl Date: Wed, 31 Mar 2021 01:41:26 +0200 Subject: [PATCH] fix: Accept application/text content-type for plain idtoken response On Cloud Run, the idtoken metadata endpoint has Content-Type application/text --- lib/googleauth/compute_engine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/googleauth/compute_engine.rb b/lib/googleauth/compute_engine.rb index eb197df9..24d3296e 100644 --- a/lib/googleauth/compute_engine.rb +++ b/lib/googleauth/compute_engine.rb @@ -112,7 +112,7 @@ def fetch_access_token options = {} case resp.status when 200 content_type = resp.headers["content-type"] - if content_type == "text/html" + if ["text/html", "application/text"].include? content_type { (target_audience ? "id_token" : "access_token") => resp.body } else Signet::OAuth2.parse_credentials resp.body, content_type