From a6731c13d10f67f5fb00b8a07b842b7e2aad7ff6 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 8 Jan 2013 13:33:01 +0100 Subject: net.http.parser: Abort if no status line is received. --- net/http/parser.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'net/http') diff --git a/net/http/parser.lua b/net/http/parser.lua index b53dfa4e..64cf38c0 100644 --- a/net/http/parser.lua +++ b/net/http/parser.lua @@ -77,6 +77,7 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb) end end end + if not first_line then error = true; return error_cb("invalid-status-line"); end len = tonumber(headers["content-length"]); -- TODO check for invalid len if client then -- FIXME handle '100 Continue' response (by skipping it) -- cgit v1.2.3