summaryrefslogtreecommitdiff
path: root/lib/gitlab/middleware/webhook_recursion_detection.rb
blob: 2677445852ceb416bf3d7ca3f86d9334d95d1a53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Gitlab
  module Middleware
    class WebhookRecursionDetection
      def initialize(app)
        @app = app
      end

      def call(env)
        headers = ActionDispatch::Request.new(env).headers

        ::Gitlab::WebHooks::RecursionDetection.set_from_headers(headers)

        @app.call(env)
      end
    end
  end
end