From: Waqas Hussain Date: Thu, 7 Feb 2013 19:18:40 +0000 (+0500) Subject: net.http.parser: Fix traceback on invalid URL in status line. X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=28d765d9f8bdb2e19fbdf39a38ac6d90ad8f2f72;hp=bf3ecf9003fca3f1cc218622ac5f385dd45aecb8;p=prosody.git net.http.parser: Fix traceback on invalid URL in status line. --- diff --git a/net/http/parser.lua b/net/http/parser.lua index 64cf38c0..9fd707d1 100644 --- a/net/http/parser.lua +++ b/net/http/parser.lua @@ -99,6 +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 end path = preprocess_path(parsed_url.path); headers.host = parsed_url.host or headers.host;