From: Tom Hughes Date: Mon, 26 Apr 2021 21:07:37 +0000 (+0100) Subject: Monkey patch oauth gem to avoid use of deprecated URI.unescape X-Git-Tag: live~2117 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/46eae20478aa4b4317ea1654b8c16854f8d5aa02?ds=inline Monkey patch oauth gem to avoid use of deprecated URI.unescape --- 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