Class: Airbrake::Rack::HttpParamsFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/airbrake/rack/http_params_filter.rb

Overview

Adds HTTP request parameters.

Since:

  • v5.7.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHttpParamsFilter

Returns a new instance of HttpParamsFilter.

Since:

  • v5.7.0



12
13
14
# File 'lib/airbrake/rack/http_params_filter.rb', line 12

def initialize
  @weight = 97
end

Instance Attribute Details

#weightInteger (readonly)

Returns:

  • (Integer)

Since:

  • v5.7.0



10
11
12
# File 'lib/airbrake/rack/http_params_filter.rb', line 10

def weight
  @weight
end

Instance Method Details

#call(notice) ⇒ Object

See Also:

  • FilterChain#refine

Since:

  • v5.7.0



17
18
19
20
21
22
23
24
# File 'lib/airbrake/rack/http_params_filter.rb', line 17

def call(notice)
  return unless (request = notice.stash[:rack_request])

  notice[:params].merge!(request.params)

  rails_params = request.env['action_dispatch.request.parameters']
  notice[:params].merge!(rails_params) if rails_params
end