debian-mirror-gitlab/lib/gitlab/middleware/read_only.rb

23 lines
434 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
module Gitlab
module Middleware
class ReadOnly
2019-07-31 22:56:46 +05:30
API_VERSIONS = (3..4).freeze
2018-03-17 18:26:18 +05:30
2018-03-27 19:54:05 +05:30
def self.internal_routes
@internal_routes ||=
API_VERSIONS.map { |version| "api/v#{version}/internal" }
end
2018-03-17 18:26:18 +05:30
def initialize(app)
@app = app
end
def call(env)
2018-05-09 12:01:36 +05:30
::Gitlab::Middleware::ReadOnly::Controller.new(@app, env).call
2018-03-17 18:26:18 +05:30
end
end
end
end