mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: set last modified date on CDN assets
This commit is contained in:
parent
81682b74b7
commit
efd6bf1490
@ -64,6 +64,11 @@ class StaticController < ApplicationController
|
|||||||
path = (Rails.root + "public/assets/" + path).to_s
|
path = (Rails.root + "public/assets/" + path).to_s
|
||||||
expires_in 1.year, public: true
|
expires_in 1.year, public: true
|
||||||
response.headers["Access-Control-Allow-Origin"] = params[:origin]
|
response.headers["Access-Control-Allow-Origin"] = params[:origin]
|
||||||
|
begin
|
||||||
|
response.headers["Last-Modified"] = File.ctime(path).httpdate
|
||||||
|
rescue Errno::ENOENT
|
||||||
|
raise Discourse::NotFound
|
||||||
|
end
|
||||||
opts = {
|
opts = {
|
||||||
disposition: nil
|
disposition: nil
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@ if defined?(Rack::MiniProfiler)
|
|||||||
(path !~ /qunit/) &&
|
(path !~ /qunit/) &&
|
||||||
(path !~ /srv\/status/) &&
|
(path !~ /srv\/status/) &&
|
||||||
(path !~ /commits-widget/) &&
|
(path !~ /commits-widget/) &&
|
||||||
|
(path !~ /^\/cdn_asset/) &&
|
||||||
(path !~ /^\/logs/)
|
(path !~ /^\/logs/)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user