From 335dbdd487cde05451078b18dbea6f87901d08e8 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Tue, 29 Jan 2013 15:28:59 +0100 Subject: catch empty routes This fixes a bug where an empty route would catch all requests resulting in all routes found with the empty route. --- lib/zero/router.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/zero/router.rb b/lib/zero/router.rb index 8d1273f..e5b513c 100644 --- a/lib/zero/router.rb +++ b/lib/zero/router.rb @@ -40,7 +40,7 @@ module Zero routes.each do |route, target| @routes[ Regexp.new( - route.gsub(VARIABLE_MATCH, VARIABLE_REGEX) + '$')] = target + '^' + route.gsub(VARIABLE_MATCH, VARIABLE_REGEX) + '$')] = target end end -- cgit v1.2.3-70-g09d2