]> git.openstreetmap.org Git - rails.git/commitdiff
Monkey patch oauth gem to avoid use of deprecated URI.escape
authorTom Hughes <tom@compton.nu>
Thu, 22 Apr 2021 17:53:27 +0000 (18:53 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 22 Apr 2021 17:53:27 +0000 (18:53 +0100)
config/initializers/oauth.rb

index 2e2f45ab88e1c46667b09719f07ca7880d238936..bad01dd3dc0fa097431b928e877480490283ee52 100644 (file)
@@ -4,6 +4,14 @@ require "oauth/rack/oauth_filter"
 Rails.configuration.middleware.use OAuth::Rack::OAuthFilter
 
 module OAuth
+  module Helper
+    def escape(value)
+      value.to_s.gsub(OAuth::RESERVED_CHARACTERS) do |c|
+        format("%%%02X", c.ord)
+      end
+    end
+  end
+
   module RequestProxy
     class RackRequest
       def method