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

4
  def build
5 6
    badge = Gitlab::Badge::Build.new(project, params[:ref])

7 8 9
    respond_to do |format|
      format.html { render_404 }
      format.svg do
10
        send_data(badge.data, type: badge.type, disposition: 'inline')
11 12 13 14
      end
    end
  end
end