From a5affc4e5d4639700b8a4ea34b2bf8d350e5ab74 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(-) (limited to 'net/http/server.lua') 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