lib/airbrake/user_informer.rb
# - body interface is .each so we cannot use anything else
# - always call .close on the old body so it can get garbage collected if it is a File
body interface is .each so we cannot use anything else
always call .close on the old body so it can get garbage collected if it is a File
body interface is . each so we cannot use anything else always call . close on the old body so it can get garbage collected if it is a File
def replace_placeholder(replacement, body, headers)
        new_body = []
        body.each { |chunk| new_body << chunk.gsub(Airbrake.user_information_placeholder || DEFAULT_PLACEHOLDER, replacement) }
        headers["Content-Length"] = new_body.inject(0) { |sum, x| sum + x.bytesize }.to_s
        new_body
      ensure
        body.close if body.respond_to?(:close)
      end
def replace_placeholder ( replacement , body , headers ) new_body = [ ] body . each { | chunk | new_body << chunk . gsub ( Airbrake . user_information_placeholder || DEFAULT_PLACEHOLDER , replacement ) } headers [ "Content-Length" ] = new_body . inject ( 0 ) { | sum , x | sum + x . bytesize } . to_s new_body ensure body . close if body . respond_to? ( :close ) end
body interface is .each so we cannot use anything else
 always call .close on the old body so it can get garbage collected if it is a File
body interface is . each so we cannot use anything else always call . close on the old body so it can get garbage collected if it is a File
replacement
body
headers