Diff

plugins/mod_http.lua @ 4678:9613673f916a

mod_http: Fix specifying method in app route keys
author Matthew Wild <mwild1@gmail.com>
date Tue, 24 Apr 2012 16:02:30 +0100
parent 4669:0e0a72679f77
child 4696:4700e318add1
line wrap: on
line diff
--- a/plugins/mod_http.lua	Tue Apr 24 16:00:20 2012 +0100
+++ b/plugins/mod_http.lua	Tue Apr 24 16:02:30 2012 +0100
@@ -19,10 +19,11 @@
 
 local function get_http_event(host, app_path, key)
 	local method, path = key:match("^(%S+)%s+(.+)$");
-	if not method and key:sub(1,1) == "/" then
+	if not method then
+		if key:sub(1,1) ~= "/" then
+			return nil;
+		end
 		method, path = "GET", key;
-	else
-		return nil;
 	end
 	path = normalize_path(path);
 	return method:upper().." "..host..app_path..path;