diff options
-rw-r--r-- | net/http/server.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/http/server.lua b/net/http/server.lua index eb30da78..8b91b4d3 100644 --- a/net/http/server.lua +++ b/net/http/server.lua @@ -174,15 +174,15 @@ function handle_request(conn, request, finish_cb) -- Some sanity checking local err_code, err; - if not host then - err_code, err = 400, "Missing or invalid 'Host' header"; - elseif not request.path then + if not request.path then err_code, err = 400, "Invalid path"; elseif not hosts[host] then if hosts[default_host] then host = default_host; - else + elseif host then err_code, err = 404, "Unknown host: "..host; + else + err_code, err = 400, "Missing or invalid 'Host' header"; end end |