lib/sinatra.rb in rtomayko-sinatra-0.3.0 vs lib/sinatra.rb in rtomayko-sinatra-0.3.1
- old
+ new
@@ -161,10 +161,10 @@
end
if host = options[:host]
return unless host === request.host
end
return unless pattern =~ request.path_info.squeeze('/')
- path_params = param_keys.zip($~.captures.map{|s| unescape(s)}).to_hash
+ path_params = param_keys.zip($~.captures.map{|s| unescape(s) if s}).to_hash
params.merge!(path_params)
splats = params.select { |k, v| k =~ /^_splat_\d+$/ }.sort.map(&:last)
unless splats.empty?
params.delete_if { |k, v| k =~ /^_splat_\d+$/ }
params["splat"] = splats