Skip to content

Commit

Permalink
Use more descriptive argument name
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Jan 21, 2021
1 parent ef1fc0c commit a05f8d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/rack/query_parser.rb
Expand Up @@ -32,12 +32,12 @@ def initialize(params_class, key_space_limit, param_depth_limit)
# Parses a query string by breaking it up at the '&'. You can also use this
# to parse cookies by changing the characters used in the second parameter
# (which defaults to '&').
def parse_query(qs, d = nil, &unescaper)
def parse_query(qs, separator = nil, &unescaper)
unescaper ||= method(:unescape)

params = make_params

(qs || '').split(d ? (COMMON_SEP[d] || /[#{d}] */n) : DEFAULT_SEP).each do |p|
(qs || '').split(separator ? (COMMON_SEP[separator] || /[#{separator}] */n) : DEFAULT_SEP).each do |p|
next if p.empty?
k, v = p.split('=', 2).map!(&unescaper)

Expand All @@ -60,11 +60,11 @@ def parse_query(qs, d = nil, &unescaper)
# query strings with parameters of conflicting types, in this case a
# ParameterTypeError is raised. Users are encouraged to return a 400 in this
# case.
def parse_nested_query(qs, d = nil)
def parse_nested_query(qs, separator = nil)
params = make_params

unless qs.nil? || qs.empty?
(qs || '').split(d ? (COMMON_SEP[d] || /[#{d}] */n) : DEFAULT_SEP).each do |p|
(qs || '').split(separator ? (COMMON_SEP[separator] || /[#{separator}] */n) : DEFAULT_SEP).each do |p|
k, v = p.split('=', 2).map! { |s| unescape(s) }

normalize_params(params, k, v, param_depth_limit)
Expand Down

0 comments on commit a05f8d5

Please sign in to comment.