Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

keep a singleton filter around that we can use when no filter is set

  • Loading branch information...
commit 481f30ee657293ddc3460ba2a031c16c536887cd 1 parent 79e91cc
@tenderlove tenderlove authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 actionpack/lib/action_dispatch/http/filter_parameters.rb
View
8 actionpack/lib/action_dispatch/http/filter_parameters.rb
@@ -22,6 +22,8 @@ module Http
module FilterParameters
@@parameter_filter_for = {}
+ NULL_FILTER = ParameterFilter.new # :nodoc:
+
def initialize(env)
super
@filtered_parameters = nil
@@ -47,7 +49,9 @@ def filtered_path
protected
def parameter_filter
- parameter_filter_for(@env["action_dispatch.parameter_filter"])
+ parameter_filter_for @env.fetch("action_dispatch.parameter_filter") {
+ return NULL_FILTER
+ }
end
def env_filter
@@ -55,7 +59,7 @@ def env_filter
end
def parameter_filter_for(filters)
- @@parameter_filter_for[filters] ||= ParameterFilter.new(filters || [])
+ @@parameter_filter_for[filters] ||= ParameterFilter.new(filters)
end
KV_RE = '[^&;=]+'
Please sign in to comment.
Something went wrong with that request. Please try again.