net.http.server: Fix to compare priority if path lengths are the same (logic fail)
authorMatthew Wild <mwild1@gmail.com>
Thu, 26 Apr 2012 04:24:43 +0100
changeset 4694 f9a091b6dfd5
parent 4693 7ef4faa056fb
child 4695 838ad61c6b2c
net.http.server: Fix to compare priority if path lengths are the same (logic fail)
net/http/server.lua
--- 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