FEATURE: Normalize the service worker route (#12343)

Re-lands the change initially proposed on #8359 but without a new nginx
location block, so it has less change surface.

Co-authored-by: Jeff Wong <awole20@gmail.com>

Co-authored-by: Jeff Wong <awole20@gmail.com>
This commit is contained in:
Rafael dos Santos Silva
2021-05-25 19:39:31 -03:00
committed by GitHub
parent b0b23a969f
commit 9118bb2076
4 changed files with 16 additions and 5 deletions

View File

@ -512,8 +512,6 @@ module ApplicationHelper
end
def client_side_setup_data
service_worker_url = Rails.env.development? ? 'service-worker.js' : Rails.application.assets_manifest.assets['service-worker.js']
setup_data = {
cdn: Rails.configuration.action_controller.asset_host,
base_url: Discourse.base_url,
@ -521,7 +519,7 @@ module ApplicationHelper
environment: Rails.env,
letter_avatar_version: LetterAvatar.version,
markdown_it_url: script_asset_path('markdown-it-bundle'),
service_worker_url: service_worker_url,
service_worker_url: 'service-worker.js',
default_locale: SiteSetting.default_locale,
asset_version: Discourse.assets_digest,
disable_custom_css: loading_admin?,