Action Dispatch HTTP Filter Parameters
Allows you to specify sensitive query string and POST parameters to filter from the request log.
# Replaces values with "[FILTERED]" for keys that match /foo|bar/i.
env["action_dispatch.parameter_filter"] = [:foo, "bar"]
For more information about filter behavior, see ActiveSupport::ParameterFilter
.
Methods
- E
- F
- N
- P
Class Public methods
new() Link
Instance Public methods
filtered_env() Link
Returns a hash of request.env with all sensitive data replaced.
filtered_parameters() Link
Returns a hash of parameters with all sensitive data replaced.
filtered_path() Link
Reconstructs a path with all sensitive GET parameters replaced.
parameter_filter() Link
Returns the ActiveSupport::ParameterFilter
object used to filter in this request.
Instance Private methods
env_filter() Link
filtered_query_string() Link
# File actionpack/lib/action_dispatch/http/filter_parameters.rb, line 71 def filtered_query_string # :doc: parts = query_string.split(/([&;])/) filtered_parts = parts.map do |part| if part.include?("=") key, value = part.split("=", 2) parameter_filter.filter(key => value).first.join("=") else part end end filtered_parts.join("") end