X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/501d13e1c0936cc3ba3d9639620517bae34e5784..6b44a1976cf07ba50ba8aed8b34434e69a45e62d:/config/initializers/router.rb?ds=inline diff --git a/config/initializers/router.rb b/config/initializers/router.rb index a1e6bbf38..4357a87f2 100644 --- a/config/initializers/router.rb +++ b/config/initializers/router.rb @@ -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)