system_assets_controller.rb 477 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class SystemAssetsController < ApplicationController
  3. def show
  4. backend = Service::SystemAssets.backend params[:identifier]
  5. raise ActiveRecord::RecordNotFound if !backend
  6. asset = backend.sendable_asset
  7. send_data(
  8. asset.content,
  9. filename: asset.filename,
  10. type: asset.type,
  11. disposition: 'inline'
  12. )
  13. expires_in 1.year, public: true
  14. end
  15. end