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)
        ::Gitlab::Middleware::ReadOnly::Controller.new(@app, env).call
      end
    end
  end
end

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)
        ReadOnly::Controller.new(@app, env).call
      end
    end
  end
end

--- 
+++ 
@@ -13,7 +13,7 @@
       end
 
       def call(env)
-        ReadOnly::Controller.new(@app, env).call
+        ::Gitlab::Middleware::ReadOnly::Controller.new(@app, env).call
       end
     end
   end
Fix "A copy of Gitlab::Middleware::Readonly has been removed from the module tree but is still active"

Similar to #34047 and #29327
