diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-09 15:07:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-09 15:07:45 +0300 |
commit | ac1dca43baa7b3b1ac7d60d89ad60fdeefed0b80 (patch) | |
tree | 33aa23ddf7f18ddbfba3d006041c460de88583b7 /app/controllers/repositories | |
parent | f4186a753b86625a83e8499af14b5badd63a2ac2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/repositories')
-rw-r--r-- | app/controllers/repositories/git_http_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/repositories/git_http_controller.rb b/app/controllers/repositories/git_http_controller.rb index 5ce2ed77417..35ea77183b8 100644 --- a/app/controllers/repositories/git_http_controller.rb +++ b/app/controllers/repositories/git_http_controller.rb @@ -12,6 +12,8 @@ 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 @@ -116,6 +118,12 @@ module Repositories def log_user_activity Users::ActivityService.new(user).execute end + + def snippet_request_allowed? + if repo_type.snippet? && Feature.disabled?(:version_snippets, user) + render plain: 'The project you were looking for could not be found.', status: :not_found + end + end end end |