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

Respond to proper format for build badge request

parent 52352dcc
......@@ -62,8 +62,14 @@ def cancel
def badge
project = Project.find_with_namespace("#{params[:namespace_id]}/#{params[:project_id]}")
image = Ci::ImageForBuildService.new.execute(project, ref: params[:ref])
send_file(image.path, filename: image.name, disposition: 'inline', type: 'image/svg+xml')
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