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

read_only.rb « middleware « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8e17073abab7239c8f8eddbd65d8abc84c875c4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module Gitlab
  module Middleware
    class ReadOnly
      API_VERSIONS = (3..4).freeze

      def self.internal_routes
        @internal_routes ||=
          API_VERSIONS.map { |version| "api/v#{version}/internal" }
      end

      def initialize(app)
        @app = app
      end

      def call(env)
        ::Gitlab::Middleware::ReadOnly::Controller.new(@app, env).call
      end
    end
  end
end