gitlab-org--gitlab-foss/lib/gitlab/middleware/read_only.rb

21 lines
374 B
Ruby
Raw Normal View History

module Gitlab
module Middleware
class ReadOnly
API_VERSIONS = (3..4)
def self.internal_routes
@internal_routes ||=
API_VERSIONS.map { |version| "api/v#{version}/internal" }
end
def initialize(app)
@app = app
end
def call(env)
2018-02-07 14:44:18 +00:00
ReadOnly::Controller.new(@app, env).call
end
end
end
end