Sha256: 92d9403c6953f232f6e33840e85b4e0f7a0cc59362c89a0dad8562e3fefe8261
Contents?: true
Size: 828 Bytes
Versions: 7
Compression:
Stored size: 828 Bytes
Contents
module Rack::ActionLogger module ParameterFiltering FILTERED = '[FILTERED]'.freeze # :nodoc: class << self def apply_filter(original_params, compiled_filters) filtered_params = {} original_params.each do |key, value| if compiled_filters.any? { |r| key =~ r } value = FILTERED elsif value.is_a?(Hash) value = apply_filter(value, compiled_filters) elsif value.is_a?(Array) value = value.map { |v| v.is_a?(Hash) ? apply_filter(v, compiled_filters) : v } end filtered_params[key] = value end filtered_params end def compile(filters) filter_strings = filters.map(&:to_s) filter_strings.map { |item| Regexp.compile(Regexp.escape(item)) } end end end end
Version data entries
7 entries across 7 versions & 1 rubygems