Class: ActionDispatch::QueryParser
Relationships & Source Files | |
Inherits: | Object |
Defined in: | actionpack/lib/action_dispatch/http/query_parser.rb |
Constant Summary
-
COMMON_SEP =
# File 'actionpack/lib/action_dispatch/http/query_parser.rb', line 10{ ";" => /; */n, ";," => /[;,] */n, "&" => /& */n, "&;" => /[&;] */n }
-
COMPAT_SEP =
# File 'actionpack/lib/action_dispatch/http/query_parser.rb', line 9/[&;] */n
-
DEFAULT_SEP =
# File 'actionpack/lib/action_dispatch/http/query_parser.rb', line 8/& */n
-
SEMICOLON_COMPAT =
# File 'actionpack/lib/action_dispatch/http/query_parser.rb', line 14defined?(::Rack::QueryParser::DEFAULT_SEP) && ::Rack::QueryParser::DEFAULT_SEP.to_s.include?(";")
Class Attribute Summary
- .strict_query_string_separator (also: #strict_query_string_separator) rw
Class Method Summary
Instance Attribute Summary
Class Attribute Details
.strict_query_string_separator (rw) Also known as: #strict_query_string_separator
[ GitHub ]# File 'actionpack/lib/action_dispatch/http/query_parser.rb', line 12
cattr_accessor :strict_query_string_separator
Class Method Details
.each_pair(s, separator = nil)
[ GitHub ]# File 'actionpack/lib/action_dispatch/http/query_parser.rb', line 20
def self.each_pair(s, separator = nil) return enum_for(:each_pair, s, separator) unless block_given? s ||= "" splitter = if separator COMMON_SEP[separator] || /[#{separator}] */n elsif strict_query_string_separator DEFAULT_SEP elsif SEMICOLON_COMPAT && s.include?(";") if strict_query_string_separator.nil? ActionDispatch.deprecator.warn("Using semicolon as a query string separator is deprecated and will not be supported in Rails 8.1 or Rack 3.0. Use `&` instead.") end COMPAT_SEP else DEFAULT_SEP end s.split(splitter).each do |part| next if part.empty? k, v = part.split("=", 2) k = URI.decode_www_form_component(k) v &&= URI.decode_www_form_component(v) yield k, v end nil end
Instance Attribute Details
#strict_query_string_separator (rw)
[ GitHub ]# File 'actionpack/lib/action_dispatch/http/query_parser.rb', line 12
cattr_accessor :strict_query_string_separator