net.http.parser: Abort if no status line is received.
authorKim Alvefur <zash@zash.se>
Tue, 8 Jan 2013 12:33:01 +0000 (13:33 +0100)
committerKim Alvefur <zash@zash.se>
Tue, 8 Jan 2013 12:33:01 +0000 (13:33 +0100)
net/http/parser.lua

index b53dfa4ede3381b96068f95038b9969845b00418..64cf38c0fc1bef6a3351ed2dff21aa096fac3470 100644 (file)
@@ -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)