From 49a6c240739e97e0ffe59cabefb481c5225959bf Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Fri, 8 Feb 2013 00:27:59 +0500 Subject: net.http.parser: Ensure full URL in status line contains a path. --- net/http/parser.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/http') diff --git a/net/http/parser.lua b/net/http/parser.lua index 9fd707d1..2545b5ac 100644 --- a/net/http/parser.lua +++ b/net/http/parser.lua @@ -99,7 +99,7 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb) parsed_url = { path = _path, query = _query }; else parsed_url = url_parse(path); - if not parsed_url then error = true; return error_cb("invalid-url"); end + if not(parsed_url and parsed_url.path) then error = true; return error_cb("invalid-url"); end end path = preprocess_path(parsed_url.path); headers.host = parsed_url.host or headers.host; -- cgit v1.2.3