Respond to proper format for build badge request
This commit is contained in:
parent
52352dccc3
commit
479d412e09
|
@ -62,9 +62,15 @@ class Projects::BuildsController < Projects::ApplicationController
|
|||
|
||||
def badge
|
||||
project = Project.find_with_namespace("#{params[:namespace_id]}/#{params[:project_id]}")
|
||||
|
||||
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
|
||||
|
||||
private
|
||||
|
||||
|
|
Loading…
Reference in New Issue