Module: TCellAgent::CsrfExceptionReporter

Defined in:
lib/tcell_agent/rails/csrf_exception.rb

Instance Method Summary collapse

Instance Method Details

#handle_unverified_requestObject



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/tcell_agent/rails/csrf_exception.rb', line 5

def handle_unverified_request
  TCellAgent::Instrumentation.safe_block('AppSensor CSRF Exception processing') do
    appfirewall_policy = TCellAgent.policy(TCellAgent::PolicyTypes::APPSENSOR)
    if appfirewall_policy.enabled
      tcell_data = request.env[TCellAgent::Instrumentation::TCELL_ID]
      if tcell_data
        tcell_data.csrf_exception_name = 'ActionController::InvalidAuthenticityToken'
      end
    end
  end

  super if defined?(super)
end