Module: TCellAgent::CsrfExceptionReporter

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

Instance Method Summary collapse

Instance Method Details

#handle_unverified_requestObject



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

def handle_unverified_request
  TCellAgent::Instrumentation.safe_block("AppSensor CSRF Exception processing") do
    rust_policies = TCellAgent.policy(TCellAgent::PolicyTypes::Rust)
    if rust_policies && rust_policies.appfirewall_enabled
      tcell_data = request.env[TCellAgent::Instrumentation::TCELL_ID]
      if tcell_data
        tcell_data.csrf_exception_name = ActionController::InvalidAuthenticityToken.name
      end
    end
  end

  super if defined?(super)
end