FIX: set last modified date on CDN assets

This commit is contained in:
Sam 2014-07-08 14:48:20 +10:00
parent 81682b74b7
commit efd6bf1490
2 changed files with 6 additions and 0 deletions

View File

@ -64,6 +64,11 @@ class StaticController < ApplicationController
path = (Rails.root + "public/assets/" + path).to_s
expires_in 1.year, public: true
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 = {
disposition: nil
}

View File

@ -27,6 +27,7 @@ if defined?(Rack::MiniProfiler)
(path !~ /qunit/) &&
(path !~ /srv\/status/) &&
(path !~ /commits-widget/) &&
(path !~ /^\/cdn_asset/) &&
(path !~ /^\/logs/)
end