refactor and fixes

This commit is contained in:
Alex Turchyn
2023-08-12 12:34:02 +03:00
parent 3b745a650d
commit 47c57158f4
17 changed files with 168 additions and 84 deletions
+14
View File
@@ -13,6 +13,20 @@ Rails.configuration.to_prepare do
response.set_header('Cache-Control', 'public, max-age=31536000') if action_name == 'show'
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
next if current_user
next if Submitter.find_signed(cookies[:submitter_sid])