1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Provide the whole response

This commit is contained in:
George Claghorn 2019-11-16 08:17:01 -05:00
parent 997770f595
commit b5c6f33f0d
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
* `process_action.action_controller` notifications now include the following in their payloads:
* `:request` - the `ActionDispatch::Request`
* `:location` - the `Location` response header
* `:response` - the `ActionDispatch::Response`
*George Claghorn*

View file

@ -20,20 +20,20 @@ module ActionController
raw_payload = {
controller: self.class.name,
action: action_name,
request: request,
params: request.filtered_parameters,
headers: request.headers,
format: request.format.ref,
method: request.request_method,
path: request.fullpath,
request: request
path: request.fullpath
}
ActiveSupport::Notifications.instrument("start_processing.action_controller", raw_payload)
ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
result = super
payload[:response] = response
payload[:status] = response.status
payload[:location] = response.filtered_location
result
ensure
append_info_to_payload(payload)