diff --git a/app/views/pwa/service_worker.js.erb b/app/views/pwa/service_worker.js.erb index 41fac14463..c34257a341 100644 --- a/app/views/pwa/service_worker.js.erb +++ b/app/views/pwa/service_worker.js.erb @@ -43,7 +43,7 @@ TurboOffline.addRule({ networkTimeout: 2, maxEntrySize: 2 * 1024 * 1024, // 2MB covers about 95% of all Fizzy blobs maxEntries: 500, - fetchOptions: { mode: "cors" } + fetchOptions: { mode: "cors", credentials: "same-origin" } }) }) diff --git a/config/initializers/active_storage.rb b/config/initializers/active_storage.rb index 0062d69793..9c39766b4a 100644 --- a/config/initializers/active_storage.rb +++ b/config/initializers/active_storage.rb @@ -14,7 +14,7 @@ # Ensure all s have a "url" attribute that's a relative # path (for portability across host name changes, beta environments, etc). def to_rich_text_attributes(*) - super.merge url: Rails.application.routes.url_helpers.polymorphic_url(self, only_path: true) + super.merge url: Rails.application.routes.url_helpers.polymorphic_url(self, only_path: true, script_name: Current.account&.slug) end end end