Comparison

net/http/parser.lua @ 5291:01f7522049fb

net.http.parser: Abort if no status line is received.
author Kim Alvefur <zash@zash.se>
date Tue, 08 Jan 2013 13:33:01 +0100
parent 5259:c85c348253bd
child 5322:8d525f58f916
comparison
equal deleted inserted replaced
5290:befb1923527d 5291:01f7522049fb
75 method, path, httpversion = line:match("^(%w+) (%S+) HTTP/(1%.[01])$"); 75 method, path, httpversion = line:match("^(%w+) (%S+) HTTP/(1%.[01])$");
76 if not method then error = true; return error_cb("invalid-status-line"); end 76 if not method then error = true; return error_cb("invalid-status-line"); end
77 end 77 end
78 end 78 end
79 end 79 end
80 if not first_line then error = true; return error_cb("invalid-status-line"); end
80 len = tonumber(headers["content-length"]); -- TODO check for invalid len 81 len = tonumber(headers["content-length"]); -- TODO check for invalid len
81 if client then 82 if client then
82 -- FIXME handle '100 Continue' response (by skipping it) 83 -- FIXME handle '100 Continue' response (by skipping it)
83 if not have_body then len = 0; end 84 if not have_body then len = 0; end
84 packet = { 85 packet = {