From d6abd57fafad52ab8b7116a0813efb1ff81c0aaf Mon Sep 17 00:00:00 2001 From: Prex International Srl <144902327+prex-international@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:52:23 +0100 Subject: [PATCH] Fix Rails 7.1 env[PATH_INFO] for root path before rails 7.0 env[PATH_INFO] was '/' for root_path, now it is a blank string --- lib/serviceworker/router.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/serviceworker/router.rb b/lib/serviceworker/router.rb index f9a6f16..e4e42ca 100644 --- a/lib/serviceworker/router.rb +++ b/lib/serviceworker/router.rb @@ -51,6 +51,7 @@ def any? def match_route(env) path = env[PATH_INFO] + path = '/' if path == '' @routes.lazy.map { |route| route.match(path) }.detect(&:itself) end end