]> git.openstreetmap.org Git - rails.git/blobdiff - config/initializers/router.rb
Merge remote-tracking branch 'upstream/pull/4190'
[rails.git] / config / initializers / router.rb
index a1e6bbf3897a8058f43a7c32e5de6e0c78d732a5..4357a87f25f47ea0cc98c8da6d9f155ed8dad750 100644 (file)
@@ -1,18 +1,14 @@
 # Some versions of ruby seem to accidentally force the encoding
 # as part of normalize_path and some don't
 
-module ActionDispatch
-  module Journey
-    class Router
-      class Utils
-        def self.normalize_path_with_encoding(path)
-          self.normalize_path_without_encoding(path).force_encoding("UTF-8")
-        end
-
-        class << self
-          alias_method_chain :normalize_path, :encoding
-        end
+module OpenStreetMap
+  module Router
+    module ForceEncoding
+      def normalize_path(path)
+        super(path).force_encoding("UTF-8")
       end
     end
   end
 end
+
+ActionDispatch::Journey::Router::Utils.singleton_class.prepend(OpenStreetMap::Router::ForceEncoding)