Sha256: 7d90991603d7d520dcec1afc8bf51f9ef7a30e67aa4b322be55418d02eff5dec
Contents?: true
Size: 807 Bytes
Versions: 9
Compression:
Stored size: 807 Bytes
Contents
module Airbrake module Rack ## # A filter that appends Rack request body to the notice. # # @example # # Read and append up to 512 bytes from Rack request's body. # Airbrake.add_filter(Airbrake::Rack::RequestBodyFilter.new(512)) # # @since v5.7.0 # @note This filter is *not* used by default. class RequestBodyFilter ## # @param [Integer] length The maximum number of bytes to read def initialize(length = 4096) @length = length end ## # @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 end end end
Version data entries
9 entries across 9 versions & 1 rubygems