cleanup routes

This commit is contained in:
Pete Matsyburka committed 2026-11-04 00:26:50 +02:00
1 parent c0c5ba48a0
commit 0bc620fa90
3 files changed
+7 -46

No files matched your search

+2 -41
View File
@@ -62,48 +62,9 @@ end
ActiveStorage::LogSubscriber.detach_from(:active_storage) if Rails.env.production?
# rubocop:disable-next Metrics/BlockLength
Rails.configuration.to_prepare do
ActiveStorage::DiskController.after_action do
response.set_header('cache-control', 'public, max-age=31536000') if action_name == 'show'
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
response.set_header('Access-Control-Allow-Origin', '*')
response.set_header('Access-Control-Allow-Methods', 'GET')
response.set_header('Access-Control-Allow-Headers', '*')
response.set_header('Access-Control-Max-Age', '1728000')
end
ActiveStorage::Blobs::RedirectController.before_action do
response.set_header('Access-Control-Allow-Origin', '*')
response.set_header('Access-Control-Allow-Methods', 'GET')
response.set_header('Access-Control-Allow-Headers', '*')
response.set_header('Access-Control-Max-Age', '1728000')
end
ActiveStorage::DirectUploadsController.before_action do
head :forbidden
ActiveStorage::DiskController.after_action(only: :show) do
response.set_header('cache-control', 'public, max-age=31536000')
end
LoadActiveStorageConfigs.call