summaryrefslogtreecommitdiff
path: root/app/controllers/projects/badges_controller.rb
blob: a4dd94b941c2ac2499d4b66f4d1afa1e388ad104 (plain)
1
2
3
4
5
6
7
8
9
10
11
class Projects::BadgesController < Projects::ApplicationController
  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