From 4ccc4d1d5a5ad2ca81924deff4be4151000e1dc7 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 12 Mar 2019 11:58:40 +0000 Subject: [PATCH] FIX: Send the `Accept: application/json` header when fetching user JSON --- plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index d3c6e79..347272d 100644 --- a/plugin.rb +++ b/plugin.rb @@ -89,7 +89,7 @@ class OAuth2BasicAuthenticator < ::Auth::OAuth2Authenticator .post_form(URI(user_json_url), 'Authorization' => bearer_token) .body else - open(user_json_url, 'Authorization' => bearer_token).read + Excon.get(user_json_url, headers: { 'Authorization' => bearer_token, 'Accept' => 'application/json' }, expects: [200]).body end user_json = JSON.parse(user_json_response)