Commit 479d412e authored by Grzegorz Bizon's avatar Grzegorz Bizon

Respond to proper format for build badge request

parent 52352dcc
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment