Sha256: 97be3956be02a4e8b16545e25abc2bb724434fa80cc0a709df95c90a96f3723c
Contents?: true
Size: 647 Bytes
Versions: 24
Compression:
Stored size: 647 Bytes
Contents
module Raygun module Services class ApplyWhitelistFilterToPayload def call(whitelist, payload) filter_hash(whitelist, payload) end private def filter_hash(whitelist, hash) # dup the input so each level of the hash is dup'd # not just the top as dup isn't deep hash = hash.dup hash.each do |k, v| unless whitelist && (whitelist[k] || whitelist[k.to_sym]) hash[k] = '[FILTERED]' end if v.is_a?(Hash) && whitelist[k].is_a?(Hash) hash[k] = filter_hash(whitelist[k], v) end end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems