From 92077e0f8d70c70a908395808b16f98ecd3a5fcd Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 31 Mar 2020 06:07:50 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/controllers/repositories/git_http_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/repositories/git_http_controller.rb b/app/controllers/repositories/git_http_controller.rb index 35ea77183b8..29bff3ef1e9 100644 --- a/app/controllers/repositories/git_http_controller.rb +++ b/app/controllers/repositories/git_http_controller.rb @@ -4,6 +4,7 @@ module Repositories class GitHttpController < Repositories::GitHttpClientController include WorkhorseRequest + before_action :snippet_request_allowed? before_action :access_check prepend_before_action :deny_head_requests, only: [:info_refs] @@ -12,8 +13,6 @@ module Repositories rescue_from Gitlab::GitAccess::ProjectCreationError, with: :render_422_with_exception rescue_from Gitlab::GitAccess::TimeoutError, with: :render_503_with_exception - before_action :snippet_request_allowed? - # GET /foo/bar.git/info/refs?service=git-upload-pack (git pull) # GET /foo/bar.git/info/refs?service=git-receive-pack (git push) def info_refs @@ -121,6 +120,7 @@ module Repositories def snippet_request_allowed? if repo_type.snippet? && Feature.disabled?(:version_snippets, user) + Gitlab::AppLogger.info('Snippet access attempt with feature disabled') render plain: 'The project you were looking for could not be found.', status: :not_found end end -- cgit v1.2.1