remove rack bug patch, it's been fixed in rack 1.1.2
Change-Id: I2bb16df697738a00fde6fa6bb61f79e72fc4d5d3 Reviewed-on: https://gerrit.instructure.com/3001 Tested-by: Hudson <hudson@instructure.com> Reviewed-by: JT Olds <jt@instructure.com>
This commit is contained in:
parent
6283c3a7fc
commit
902cf8cc7c
1
Gemfile
1
Gemfile
|
@ -27,6 +27,7 @@ gem 'mime-types', '1.16', :require => 'mime/types'
|
|||
gem 'mini_magick', '1.3.2'
|
||||
gem 'nokogiri', '1.4.1'
|
||||
gem 'oauth', '0.3.4' # 0.3.6 breaks our integration with google docs
|
||||
gem 'rack', '~> 1.1.2' # rails requires ~> 1.1.0 but 1.1.0 has a param quoting bug
|
||||
gem 'ratom', '0.6.7', :require => "atom"
|
||||
gem 'rscribd', '1.2.0'
|
||||
gem 'ruby-net-ldap', '0.0.4', :require => 'net/ldap'
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
if Rack::VERSION == [1,1]
|
||||
|
||||
module Rack
|
||||
module Utils
|
||||
def parse_query(qs, d = nil)
|
||||
params = {}
|
||||
|
||||
(qs || '').split(d ? %r{[#{d}] *}n : DEFAULT_SEP).each do |p|
|
||||
k, v = p.split('=', 2).map { |x| unescape(x) }
|
||||
if cur = params[k]
|
||||
if cur.class == Array
|
||||
params[k] << v
|
||||
else
|
||||
params[k] = [cur, v]
|
||||
end
|
||||
else
|
||||
params[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
return params
|
||||
end
|
||||
module_function :parse_query
|
||||
|
||||
def normalize_params(params, name, v = nil)
|
||||
name =~ %r(\A[\[\]]*([^\[\]]+)\]*)
|
||||
k = $1 || ''
|
||||
after = $' || ''
|
||||
|
||||
return if k.empty?
|
||||
|
||||
if after == ""
|
||||
params[k] = v
|
||||
elsif after == "[]"
|
||||
params[k] ||= []
|
||||
raise TypeError, "expected Array (got #{params[k].class.name}) for param `#{k}'" unless params[k].is_a?(Array)
|
||||
params[k] << v
|
||||
elsif after =~ %r(^\[\]\[([^\[\]]+)\]$) || after =~ %r(^\[\](.+)$)
|
||||
child_key = $1
|
||||
params[k] ||= []
|
||||
raise TypeError, "expected Array (got #{params[k].class.name}) for param `#{k}'" unless params[k].is_a?(Array)
|
||||
if params[k].last.is_a?(Hash) && !params[k].last.key?(child_key)
|
||||
normalize_params(params[k].last, child_key, v)
|
||||
else
|
||||
params[k] << normalize_params({}, child_key, v)
|
||||
end
|
||||
else
|
||||
params[k] ||= {}
|
||||
raise TypeError, "expected Hash (got #{params[k].class.name}) for param `#{k}'" unless params[k].is_a?(Hash)
|
||||
params[k] = normalize_params(params[k], after, v)
|
||||
end
|
||||
|
||||
return params
|
||||
end
|
||||
module_function :normalize_params
|
||||
end
|
||||
end
|
||||
|
||||
end # Rack::VERSION
|
Loading…
Reference in New Issue