aboutsummaryrefslogtreecommitdiffstats
path: root/net/http/parser.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-12-26 20:35:40 +0100
committerKim Alvefur <zash@zash.se>2012-12-26 20:35:40 +0100
commit299b8c459dcb702a672496a403376125bd501142 (patch)
tree5bbd6b49aac7077d566f6bc7eaf3298a445a5d3e /net/http/parser.lua
parent02a1cdf94866f4d3c7d985d659f50b5185d4f2a7 (diff)
parent020dc0052ac01b65d59bcf4e45c481ee446c6c64 (diff)
downloadprosody-299b8c459dcb702a672496a403376125bd501142.tar.gz
prosody-299b8c459dcb702a672496a403376125bd501142.zip
Merge 0.9->trunk
Diffstat (limited to 'net/http/parser.lua')
-rw-r--r--net/http/parser.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/http/parser.lua b/net/http/parser.lua
index c760a0a4..b53dfa4e 100644
--- a/net/http/parser.lua
+++ b/net/http/parser.lua
@@ -91,7 +91,14 @@ function httpstream.new(success_cb, error_cb, parser_type, options_cb)
responseheaders = headers;
};
else
- local parsed_url = url_parse(path);
+ local parsed_url;
+ if path:byte() == 47 then -- starts with /
+ local _path, _query = path:match("([^?]*).?(.*)");
+ if _query == "" then _query = nil; end
+ parsed_url = { path = _path, query = _query };
+ else
+ parsed_url = url_parse(path);
+ end
path = preprocess_path(parsed_url.path);
headers.host = parsed_url.host or headers.host;