Class: Airbrake::Rack::RequestBodyFilter
- Inherits:
-
Object
- Object
- Airbrake::Rack::RequestBodyFilter
- Defined in:
- lib/airbrake/rack/request_body_filter.rb
Overview
Note:
This filter is not used by default.
A filter that appends Rack request body to the notice.
Instance Attribute Summary collapse
- #weight ⇒ Integer readonly
Instance Method Summary collapse
- #call(notice) ⇒ Object
-
#initialize(length = 4096) ⇒ RequestBodyFilter
constructor
A new instance of RequestBodyFilter.
Constructor Details
#initialize(length = 4096) ⇒ RequestBodyFilter
Returns a new instance of RequestBodyFilter.
18 19 20 21 |
# File 'lib/airbrake/rack/request_body_filter.rb', line 18 def initialize(length = 4096) @length = length @weight = 95 end |
Instance Attribute Details
#weight ⇒ Integer (readonly)
15 16 17 |
# File 'lib/airbrake/rack/request_body_filter.rb', line 15 def weight @weight end |
Instance Method Details
#call(notice) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/airbrake/rack/request_body_filter.rb', line 24 def call(notice) return unless (request = notice.stash[:rack_request]) return unless request.body notice[:environment][:body] = request.body.read(@length) request.body.rewind end |