Skip to content

Commit 8197e57

Browse files
committed
Add settings of web framework to AppSec context state
1 parent c6dfe56 commit 8197e57

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/datadog/appsec/contrib/rails/patches/process_action_patch.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ def process_action(*args)
1111
context = request.env[Datadog::AppSec::Ext::CONTEXT_KEY]
1212
return super unless context
1313

14+
context.state[:web_framework] = 'rails'
15+
1416
# TODO: handle exceptions, except for super
1517
gateway_request = Gateway::Request.new(request)
1618
http_response, _gateway_request = Instrumentation.gateway.push('rails.request.action', gateway_request) do

lib/datadog/appsec/contrib/sinatra/gateway/watcher.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def watch_request_dispatch(gateway = Instrumentation.gateway)
2525
gateway.watch('sinatra.request.dispatch', :appsec) do |stack, gateway_request|
2626
context = gateway_request.env[AppSec::Ext::CONTEXT_KEY] # : Context
2727

28+
context.state[:web_framework] = 'sinatra'
29+
2830
persistent_data = {
2931
'server.request.body' => gateway_request.form_hash
3032
}

0 commit comments

Comments
 (0)