From 1f12ee2a7a7b296f2da0359446370964b7537417 Mon Sep 17 00:00:00 2001 From: Marc Boquet Date: Wed, 25 Nov 2020 13:31:58 +0100 Subject: [PATCH] Initialize Net::HTTP::Post with URI instead of string --- lib/patreon/oauth.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/patreon/oauth.rb b/lib/patreon/oauth.rb index 2b8ff14..3c7f126 100644 --- a/lib/patreon/oauth.rb +++ b/lib/patreon/oauth.rb @@ -29,7 +29,7 @@ def refresh_token(refresh_token, redirect_uri) def update_token(params) url = URI.parse('https://www.patreon.com/api/oauth2/token') url.query = URI.encode_www_form(params) - req = Net::HTTP::Post.new(url.to_s) + req = Net::HTTP::Post.new(url) req['User-Agent'] = Utils::Client.user_agent_string res = Net::HTTP.start(url.host, url.port, :use_ssl => true) {|http| http.request(req)} JSON.parse(res.body)