Welcome to mirror list, hosted at ThFree Co, Russian Federation.

project_url_constrainer.rb « constraints « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 64eefd67d81e2d2c2df820cc723460c83c4a72d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

module Constraints
  class ProjectUrlConstrainer
    def matches?(request)
      namespace_path = request.params[:namespace_id]
      project_path = request.params[:project_id] || request.params[:id]
      full_path = [namespace_path, project_path].join('/')

      ProjectPathValidator.valid_path?(full_path)
    end
  end
end