mirror of
https://github.com/docusealco/docuseal
synced 2026-11-09 23:42:32 -05:00
block active storage routes
This commit is contained in:
1 parent
8fe0293ebe
commit
c0c5ba48a0
1 file changed
+21
@@ -62,11 +62,32 @@ end
|
|||||||
|
|
||||||
ActiveStorage::LogSubscriber.detach_from(:active_storage) if Rails.env.production?
|
ActiveStorage::LogSubscriber.detach_from(:active_storage) if Rails.env.production?
|
||||||
|
|
||||||
|
# rubocop:disable-next Metrics/BlockLength
|
||||||
Rails.configuration.to_prepare do
|
Rails.configuration.to_prepare do
|
||||||
ActiveStorage::DiskController.after_action do
|
ActiveStorage::DiskController.after_action do
|
||||||
response.set_header('cache-control', 'public, max-age=31536000') if action_name == 'show'
|
response.set_header('cache-control', 'public, max-age=31536000') if action_name == 'show'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ActiveStorage::DiskController.prepend_before_action(only: :update) do
|
||||||
|
head :forbidden
|
||||||
|
end
|
||||||
|
|
||||||
|
ActiveStorage::Blobs::RedirectController.prepend_before_action do
|
||||||
|
head :forbidden
|
||||||
|
end
|
||||||
|
|
||||||
|
ActiveStorage::Representations::RedirectController.prepend_before_action do
|
||||||
|
head :forbidden
|
||||||
|
end
|
||||||
|
|
||||||
|
ActiveStorage::Representations::ProxyController.prepend_before_action do
|
||||||
|
head :forbidden
|
||||||
|
end
|
||||||
|
|
||||||
|
ActiveStorage::Blobs::ProxyController.prepend_before_action do
|
||||||
|
head :forbidden
|
||||||
|
end
|
||||||
|
|
||||||
ActiveStorage::Blobs::ProxyController.before_action do
|
ActiveStorage::Blobs::ProxyController.before_action do
|
||||||
response.set_header('Access-Control-Allow-Origin', '*')
|
response.set_header('Access-Control-Allow-Origin', '*')
|
||||||
response.set_header('Access-Control-Allow-Methods', 'GET')
|
response.set_header('Access-Control-Allow-Methods', 'GET')
|
||||||
|
|||||||
Reference in new issue
Block a user