GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 442a49db authored by Grzegorz Bizon's avatar Grzegorz Bizon

Skip authentication when requesting commit status badge

parent 28c4c949
......@@ -10,6 +10,11 @@ class Projects::CommitController < Projects::ApplicationController
before_action :commit
before_action :define_show_vars, only: [:show, :builds]
# Skip authentication for status badge only
skip_before_action :authenticate_user!, :reject_blocked!, :project,
:repository, :require_non_empty_project, :authorize_download_code!,
:commit, only: [:badge]
def show
return git_not_found! unless @commit
......@@ -58,7 +63,8 @@ def branches
def badge
image =, ref: params[:id])
project = Project.find_with_namespace("#{params[:namespace_id]}/#{params[:project_id]}")
image =, ref: params[:id])
send_file(image.path, filename:, disposition: 'inline', type: 'image/svg+xml')
......@@ -498,7 +498,7 @@
to: 'commit#badge',
constraints: { format: /png/ },
as: :commit_badge
as: :build_badge
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