block search bots

This commit is contained in:
Pete Matsyburka committed 2026-11-08 09:48:22 +02:00
1 parent 621431166b
commit dbf446efe1
3 files changed
+55

No files matched your search

@@ -34,6 +34,12 @@ module Api
@record = attachment.record
@record = @record.record if @record.is_a?(ActiveStorage::Attachment)
if DetectBrowserDevice.search_bot?(request.user_agent)
Rollbar.warning("Search bot: #{@record.class.name} #{@record.id}") if defined?(Rollbar)
raise ActionController::RoutingError, 'Not Found'
end
authorization_check!(attachment, @record, exp)
if request.headers['Range'].present?