net.http.parser: Fix traceback on invalid URL in status line.
authorWaqas Hussain <waqas20@gmail.com>
Thu, 7 Feb 2013 19:18:40 +0000 (00:18 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Thu, 7 Feb 2013 19:18:40 +0000 (00:18 +0500)
net/http/parser.lua

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