# HG changeset patch # User Kim Alvefur # Date 1592919837 -7200 # Node ID f4215f8baa5d965fadfe6804dae088b38b518d6f # Parent a23328c463897cdb4312b84566192cca7db10983 net.http.server: Fix reporting of missing Host header The "Missing or invalid 'Host' header" case was dead code previously because `host` was always at least an empty string. diff -r a23328c46389 -r f4215f8baa5d net/http/server.lua --- a/net/http/server.lua Tue Jun 23 15:39:31 2020 +0200 +++ b/net/http/server.lua Tue Jun 23 15:43:57 2020 +0200 @@ -207,7 +207,8 @@ }; conn._http_open_response = response; - local host = (request.headers.host or ""):gsub(":%d+$",""); + local host = request.headers.host; + if host then host = host:gsub(":%d+$",""); end -- Some sanity checking local err_code, err;