mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Disable template digesting for Active Storage controllers
Error entries appear in the log when we request ActiveStorage controllers (`ActiveStorage::Representations::ProxyController#show`, `ActiveStorage::Blobs::ProxyController#show`). These entries look like: "Couldn't find template for digesting: active_storage/representations/proxy/show". These controllers use the method `ActionController::ConditionalGet#http_cache_forever`, and therefore `ActionController::ConditionalGet#combine_etags` method, and therefore `ActionController::EtagWithTemplateDigest` module via `etaggers` array. `ActionController::EtagWithTemplateDigest` module requires a template (view). We have no views in ActiveStorage, so `EtagWithTemplateDigest` is now turned off in ActiveStorage controllers by `etag_with_template_digest` class attribute.
This commit is contained in:
parent
31148cd6be
commit
6af5662165
1 changed files with 2 additions and 0 deletions
|
@ -6,6 +6,8 @@ class ActiveStorage::BaseController < ActionController::Base
|
|||
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
self.etag_with_template_digest = false
|
||||
|
||||
private
|
||||
def stream(blob)
|
||||
blob.download do |chunk|
|
||||
|
|
Loading…
Reference in a new issue