lib/rack/urlmap.rb in rack-1.5.1 vs lib/rack/urlmap.rb in rack-1.5.2
- old
+ new
@@ -11,10 +11,11 @@
# URLMap dispatches in such a way that the longest paths are tried
# first, since they are most specific.
class URLMap
NEGATIVE_INFINITY = -1.0 / 0.0
+ INFINITY = 1.0 / 0.0
def initialize(map = {})
remap(map)
end
@@ -33,10 +34,10 @@
location = location.chomp('/')
match = Regexp.new("^#{Regexp.quote(location).gsub('/', '/+')}(.*)", nil, 'n')
[host, location, match, app]
}.sort_by do |(host, location, _, _)|
- [host ? -host.size : NEGATIVE_INFINITY, -location.size]
+ [host ? -host.size : INFINITY, -location.size]
end
end
def call(env)
path = env["PATH_INFO"]