class Airbrake::Rack::RequestBodyFilter
@note This filter is not used by default.
@since v5.7.0
Airbrake.add_filter(Airbrake::Rack::RequestBodyFilter.new(512))
# Read and append up to 512 bytes from Rack request’s body.
@example
A filter that appends Rack request body to the notice.
def call(notice)
- See: Airbrake::FilterChain#refine -
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
def initialize(length = 4096)
-
length
(Integer
) -- The maximum number of bytes to read
def initialize(length = 4096) @length = length @weight = 95 end