mirror of
https://github.com/discourse/discourse.git
synced 2025-01-30 22:04:18 +08:00
FIX: add check for missing assets file in development
This commit is contained in:
parent
89bbc94331
commit
44ee26721a
|
@ -163,8 +163,10 @@ class StaticController < ApplicationController
|
||||||
# However, ensure that these may be cached and served for longer on servers.
|
# However, ensure that these may be cached and served for longer on servers.
|
||||||
immutable_for 1.year
|
immutable_for 1.year
|
||||||
|
|
||||||
path = File.expand_path(Rails.root + "public/assets/#{Rails.application.assets_manifest.assets['service-worker.js']}")
|
if Rails.application.assets_manifest.assets['service-worker.js']
|
||||||
response.headers["Last-Modified"] = File.ctime(path).httpdate
|
path = File.expand_path(Rails.root + "public/assets/#{Rails.application.assets_manifest.assets['service-worker.js']}")
|
||||||
|
response.headers["Last-Modified"] = File.ctime(path).httpdate
|
||||||
|
end
|
||||||
render(
|
render(
|
||||||
plain: Rails.application.assets_manifest.find_sources('service-worker.js').first,
|
plain: Rails.application.assets_manifest.find_sources('service-worker.js').first,
|
||||||
content_type: 'application/javascript'
|
content_type: 'application/javascript'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user