Software /
code /
prosody
Diff
net/http/parser.lua @ 5323:4c30f638ff55
net.http.parser: Ensure full URL in status line contains a path.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Fri, 08 Feb 2013 00:27:59 +0500 |
parent | 5322:8d525f58f916 |
child | 5460:274c10668fe8 |
line wrap: on
line diff
--- a/net/http/parser.lua Fri Feb 08 00:18:40 2013 +0500 +++ b/net/http/parser.lua Fri Feb 08 00:27:59 2013 +0500 @@ -99,7 +99,7 @@ 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;