badges_controller.rb 458 Bytes
Newer Older
1
class Projects::BadgesController < Projects::ApplicationController
2 3
  layout 'project_settings'
  before_action :authorize_admin_project!, only: [:index]
4 5
  before_action :no_cache_headers, except: [:index]

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

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