Skip to content

Commit

Permalink
Monkey patch oauth gem to avoid use of deprecated URI.unescape
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Apr 26, 2021
1 parent 89456c8 commit 46eae20
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/initializers/oauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ def escape(value)
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
Expand Down

0 comments on commit 46eae20

Please sign in to comment.