The personal finance app for everyone (by everyone)
Ruby
Allow PWA assets without forgery checks
sure-adminf4ace1217711
diff --git a/app/controllers/pwa_controller.rb b/app/controllers/pwa_controller.rbindex 46c949e121..287936efc1 100644--- a/app/controllers/pwa_controller.rb+++ b/app/controllers/pwa_controller.rb@@ -1,5 +1,6 @@class PwaController < ApplicationControllerskip_authentication+ skip_forgery_protectiondef manifest# Force JSON format to avoid MissingTemplate errors when browsers request /manifestdiff --git a/test/controllers/pwa_controller_test.rb b/test/controllers/pwa_controller_test.rbindex b7b18ce5a1..a82244df5e 100644--- a/test/controllers/pwa_controller_test.rb+++ b/test/controllers/pwa_controller_test.rb@@ -8,4 +8,15 @@ class PwaControllerTest < ActionDispatch::IntegrationTestassert_equal "application/manifest+json", response.media_typeassert_includes response.body, '"start_url": "/"'end++ test "service worker responds successfully without origin or referer headers" do+ get "/service-worker", headers: {+ "Accept" => "*/*",+ "DNT" => "1",+ "Sec-GPC" => "1"+ }++ assert_response :success+ assert_equal "application/javascript", response.media_type+ endend