From e8746c77dad085ea37dda934eff87230796439fa Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 28 Apr 2012 00:51:36 +0100 Subject: net.http.server: Fix traceback on missing host header (thanks darkrain) --- net/http/server.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/http/server.lua b/net/http/server.lua index 325eb42f..eb30da78 100644 --- a/net/http/server.lua +++ b/net/http/server.lua @@ -178,8 +178,7 @@ function handle_request(conn, request, finish_cb) err_code, err = 400, "Missing or invalid 'Host' header"; elseif not request.path then err_code, err = 400, "Invalid path"; - end - if not hosts[host] then + elseif not hosts[host] then if hosts[default_host] then host = default_host; else -- cgit v1.2.3