diff plugins/mod_http.lua @ 5205:f7ff48494c2b

Merge 0.9->trunk
author Matthew Wild <mwild1@gmail.com>
date Thu, 29 Nov 2012 07:16:45 +0500
parents 0b4f680ea116
children 6f5640375358
line wrap: on
line diff
--- a/plugins/mod_http.lua	Thu Nov 22 21:57:35 2012 +0000
+++ b/plugins/mod_http.lua	Thu Nov 29 07:16:45 2012 +0500
@@ -88,10 +88,10 @@
 					local data = handler;
 					handler = function () return data; end
 				elseif event_name:sub(-2, -1) == "/*" then
-					local base_path = event_name:match("/(.+)/*$");
+					local base_path_len = #event_name:match("(/.+/)%*$")+1;
 					local _handler = handler;
 					handler = function (event)
-						local path = event.request.path:sub(#base_path+1);
+						local path = event.request.path:sub(base_path_len);
 						return _handler(event, path);
 					end;
 				end