Class: Gitlab::Middleware::WebhookRecursionDetection

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/middleware/webhook_recursion_detection.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ WebhookRecursionDetection

Returns a new instance of WebhookRecursionDetection.


6
7
8
# File 'lib/gitlab/middleware/webhook_recursion_detection.rb', line 6

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object


10
11
12
13
14
15
16
# File 'lib/gitlab/middleware/webhook_recursion_detection.rb', line 10

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

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

  @app.call(env)
end