From 41fe97390ceddf945f3d967b8fdb3de4c66b7dea Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 18 Mar 2022 20:02:30 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-9-stable-ee --- app/graphql/resolvers/blobs_resolver.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/graphql/resolvers/blobs_resolver.rb') diff --git a/app/graphql/resolvers/blobs_resolver.rb b/app/graphql/resolvers/blobs_resolver.rb index d0eb2deaf48..0704a845bb0 100644 --- a/app/graphql/resolvers/blobs_resolver.rb +++ b/app/graphql/resolvers/blobs_resolver.rb @@ -30,8 +30,17 @@ module Resolvers return [] if repository.empty? ref ||= repository.root_ref + validate_ref(ref) repository.blobs_at(paths.map { |path| [ref, path] }) end + + private + + def validate_ref(ref) + unless Gitlab::GitRefValidator.validate(ref) + raise Gitlab::Graphql::Errors::ArgumentError, 'Ref is not valid' + end + end end end -- cgit v1.2.1