Class: ActionDispatch::StructuredEventSubscriber

Inherits:
ActiveSupport::StructuredEventSubscriber
  • Object
show all
Defined in:
lib/action_dispatch/structured_event_subscriber.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#redirect(event) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/action_dispatch/structured_event_subscriber.rb', line 5

def redirect(event)
  payload = event.payload
  status = payload[:status]

  emit_event("action_dispatch.redirect", {
    location: payload[:location],
    status: status,
    status_name: Rack::Utils::HTTP_STATUS_CODES[status],
    duration_ms: event.duration.round(2),
    source_location: payload[:source_location]
  })
end