File tree 4 files changed +22
-0
lines changed
4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ * Disables the session in ` ActiveStorage::Blobs::ProxyController `
2+ and ` ActiveStorage::Representations::ProxyController `
3+ in order to allow caching by default in some CDNs as CloudFlare
4+
5+ Fixes #44136
6+
7+ * Bruno Prieto*
8+
19## Rails 7.0.8 (September 09, 2023) ##
210
311* No changes.
Original file line number Diff line number Diff line change 99class ActiveStorage ::Blobs ::ProxyController < ActiveStorage ::BaseController
1010 include ActiveStorage ::SetBlob
1111 include ActiveStorage ::Streaming
12+ include ActiveStorage ::DisableSession
1213
1314 def show
1415 if request . headers [ "Range" ] . present?
Original file line number Diff line number Diff line change 88# {Authenticated Controllers}[https://guides.rubyonrails.org/active_storage_overview.html#authenticated-controllers].
99class ActiveStorage ::Representations ::ProxyController < ActiveStorage ::Representations ::BaseController
1010 include ActiveStorage ::Streaming
11+ include ActiveStorage ::DisableSession
1112
1213 def show
1314 http_cache_forever public : true do
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ # This concern disables the session in order to allow caching by default in some CDNs as CloudFlare.
4+ module ActiveStorage ::DisableSession
5+ extend ActiveSupport ::Concern
6+
7+ included do
8+ before_action do
9+ request . session_options [ :skip ] = true
10+ end
11+ end
12+ end
You can’t perform that action at this time.
0 commit comments