badges_controller.rb 401 Bytes
Newer Older
1
class Projects::BadgesController < Projects::ApplicationController
2
  before_action :no_cache_headers
3

4 5 6 7 8 9 10 11 12 13
  def build
    respond_to do |format|
      format.html { render_404 }
      format.svg do
        image = Ci::ImageForBuildService.new.execute(project, ref: params[:ref])
        send_file(image.path, filename: image.name, disposition: 'inline', type: 'image/svg+xml')
      end
    end
  end
end