From 46eae20478aa4b4317ea1654b8c16854f8d5aa02 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 26 Apr 2021 22:07:37 +0100 Subject: [PATCH] Monkey patch oauth gem to avoid use of deprecated URI.unescape --- config/initializers/oauth.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/initializers/oauth.rb b/config/initializers/oauth.rb index 276fd350c..9179e431f 100644 --- a/config/initializers/oauth.rb +++ b/config/initializers/oauth.rb @@ -13,6 +13,12 @@ module OAuth end.join end.force_encoding(Encoding::US_ASCII) end + + def unescape(value) + value.to_s.gsub(/%\h{2}/) do |c| + c[1..-1].to_i(16).chr + end.force_encoding(Encoding::UTF_8) + end end module RequestProxy -- 2.45.1