diff --git a/lib/datadog/appsec/contrib/graphql/gateway/watcher.rb b/lib/datadog/appsec/contrib/graphql/gateway/watcher.rb index 4520e05b111..7fae08aad72 100644 --- a/lib/datadog/appsec/contrib/graphql/gateway/watcher.rb +++ b/lib/datadog/appsec/contrib/graphql/gateway/watcher.rb @@ -46,14 +46,7 @@ def watch_multiplex(gateway = Instrumentation.gateway) next [nil, [[:block, event]]] if block - ret, res = stack.call(gateway_multiplex.arguments) - - if event - res ||= [] - res << [:monitor, event] - end - - [ret, res] + stack.call(gateway_multiplex.arguments) end end end diff --git a/lib/datadog/appsec/contrib/rack/gateway/watcher.rb b/lib/datadog/appsec/contrib/rack/gateway/watcher.rb index fb7e095f834..b5c55a15ac9 100644 --- a/lib/datadog/appsec/contrib/rack/gateway/watcher.rb +++ b/lib/datadog/appsec/contrib/rack/gateway/watcher.rb @@ -50,14 +50,7 @@ def watch_request(gateway = Instrumentation.gateway) block = Rack::Reactive::Request.publish(engine, gateway_request) next [nil, [[:block, event]]] if block - ret, res = stack.call(gateway_request.request) - - if event - res ||= [] - res << [:monitor, event] - end - - [ret, res] + stack.call(gateway_request.request) end end @@ -88,14 +81,7 @@ def watch_response(gateway = Instrumentation.gateway) block = Rack::Reactive::Response.publish(engine, gateway_response) next [nil, [[:block, event]]] if block - ret, res = stack.call(gateway_response.response) - - if event - res ||= [] - res << [:monitor, event] - end - - [ret, res] + stack.call(gateway_response.response) end end @@ -126,14 +112,7 @@ def watch_request_body(gateway = Instrumentation.gateway) block = Rack::Reactive::RequestBody.publish(engine, gateway_request) next [nil, [[:block, event]]] if block - ret, res = stack.call(gateway_request.request) - - if event - res ||= [] - res << [:monitor, event] - end - - [ret, res] + stack.call(gateway_request.request) end end end diff --git a/lib/datadog/appsec/contrib/rails/gateway/watcher.rb b/lib/datadog/appsec/contrib/rails/gateway/watcher.rb index 6fb24027f61..0a1bd7ea9f5 100644 --- a/lib/datadog/appsec/contrib/rails/gateway/watcher.rb +++ b/lib/datadog/appsec/contrib/rails/gateway/watcher.rb @@ -46,14 +46,7 @@ def watch_request_action(gateway = Instrumentation.gateway) block = Rails::Reactive::Action.publish(engine, gateway_request) next [nil, [[:block, event]]] if block - ret, res = stack.call(gateway_request.request) - - if event - res ||= [] - res << [:monitor, event] - end - - [ret, res] + stack.call(gateway_request.request) end end end diff --git a/lib/datadog/appsec/contrib/sinatra/gateway/watcher.rb b/lib/datadog/appsec/contrib/sinatra/gateway/watcher.rb index 442d829cd34..6524fef0ada 100644 --- a/lib/datadog/appsec/contrib/sinatra/gateway/watcher.rb +++ b/lib/datadog/appsec/contrib/sinatra/gateway/watcher.rb @@ -48,14 +48,7 @@ def watch_request_dispatch(gateway = Instrumentation.gateway) block = Rack::Reactive::RequestBody.publish(engine, gateway_request) next [nil, [[:block, event]]] if block - ret, res = stack.call(gateway_request.request) - - if event - res ||= [] - res << [:monitor, event] - end - - [ret, res] + stack.call(gateway_request.request) end end @@ -86,14 +79,7 @@ def watch_request_routed(gateway = Instrumentation.gateway) block = Sinatra::Reactive::Routed.publish(engine, [gateway_request, gateway_route_params]) next [nil, [[:block, event]]] if block - ret, res = stack.call(gateway_request.request) - - if event - res ||= [] - res << [:monitor, event] - end - - [ret, res] + stack.call(gateway_request.request) end end end diff --git a/lib/datadog/appsec/monitor/gateway/watcher.rb b/lib/datadog/appsec/monitor/gateway/watcher.rb index e8beb102e52..3a17b7dc831 100644 --- a/lib/datadog/appsec/monitor/gateway/watcher.rb +++ b/lib/datadog/appsec/monitor/gateway/watcher.rb @@ -44,14 +44,7 @@ def watch_user_id(gateway = Instrumentation.gateway) block = Monitor::Reactive::SetUser.publish(engine, user) throw(Datadog::AppSec::Ext::INTERRUPT, [nil, [[:block, event]]]) if block - ret, res = stack.call(user) - - if event - res ||= [] - res << [:monitor, event] - end - - [ret, res] + stack.call(user) end end end