Diff

net/http/server.lua @ 4694:f9a091b6dfd5

net.http.server: Fix to compare priority if path lengths are the same (logic fail)
author Matthew Wild <mwild1@gmail.com>
date Thu, 26 Apr 2012 04:24:43 +0100
parent 4691:a164fc7057ae
child 4704:d6c4e58333cf
line wrap: on
line diff
--- a/net/http/server.lua	Wed Apr 25 23:16:37 2012 +0100
+++ b/net/http/server.lua	Thu Apr 26 04:24:43 2012 +0100
@@ -50,7 +50,7 @@
 		table.sort(handlers_array, function(b, a)
 			local a_score, b_score = matching_handlers_set[a], matching_handlers_set[b];
 			for i = 1, #a_score do
-				if a ~= b then -- If equal, compare next score value
+				if a_score[i] ~= b_score[i] then -- If equal, compare next score value
 					return a_score[i] < b_score[i];
 				end
 			end