mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-20 14:11:11 +00:00
Validate refs used in controllers don't have spaces
This avoids an unnecessary call to Gitaly and reduces gRPC errors. * Closes https://gitlab.com/gitlab-org/gitaly/issues/1425 * Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/58572
This commit is contained in:
@ -113,6 +113,9 @@ module ExtractsPath
|
||||
@id = get_id
|
||||
@ref, @path = extract_ref(@id)
|
||||
@repo = @project.repository
|
||||
@ref.strip!
|
||||
|
||||
raise InvalidPathError if @ref.match?(/\s/)
|
||||
|
||||
@commit = @repo.commit(@ref)
|
||||
|
||||
|
Reference in New Issue
Block a user