Files
sure/app/controllers/pwa_controller.rb
sentry[bot] 24ba7ab6a0 fix(pwa): harden manifest render to explicitly use json format (#2508)
* fix(pwa): harden manifest render to explicitly use json format

* Fix RuboCop spacing in PWA manifest render

---------

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
Co-authored-by: sure-admin <sure-admin@splashblot.com>
2026-06-30 07:51:51 +02:00

16 lines
609 B
Ruby

class PwaController < ApplicationController
skip_authentication
def manifest
# Force JSON format to avoid MissingTemplate errors when browsers request /manifest
# with HTML Accept headers (Safari Mobile does this for PWA manifest discovery)
render "pwa/manifest", formats: [ :json ], content_type: "application/manifest+json"
end
def service_worker
# Explicitly render JS template to avoid format negotiation issues
render "pwa/service-worker", content_type: "application/javascript"
end
# Renders app/views/pwa/service-worker.js with content type application/javascript
end