aboutsummaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2013-02-08 00:27:59 +0500
committerWaqas Hussain <waqas20@gmail.com>2013-02-08 00:27:59 +0500
commit42c8d5bd2416ae0cd8a12f718f3ae9e10ea43e42 (patch)
treec7fab4bc61fcd2ffd08a4f6679870367d0e75b5b /net/http
parent4337cb52675cf61386397079495bdf90ac672d38 (diff)
downloadprosody-42c8d5bd2416ae0cd8a12f718f3ae9e10ea43e42.tar.gz
prosody-42c8d5bd2416ae0cd8a12f718f3ae9e10ea43e42.zip
net.http.parser: Ensure full URL in status line contains a path.
Diffstat (limited to 'net/http')
-rw-r--r--net/http/parser.lua2
1 files changed, 1 insertions, 1 deletions
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;