diff options
Diffstat (limited to 'app/controllers/repositories')
-rw-r--r-- | app/controllers/repositories/git_http_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |