aboutsummaryrefslogtreecommitdiffstats
path: root/net/http.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-01-15 04:08:06 +0000
committerMatthew Wild <mwild1@gmail.com>2009-01-15 04:08:06 +0000
commit661b30bfc70217b74f21182ac708befae93cfaf0 (patch)
tree44529aab464a668c9426550d46de1b5e4ad2e87f /net/http.lua
parent60886540232400adc81e712f5026e0d6f2cfbf07 (diff)
downloadprosody-661b30bfc70217b74f21182ac708befae93cfaf0.tar.gz
prosody-661b30bfc70217b74f21182ac708befae93cfaf0.zip
net.http: Fix to send query part of URL to server
Diffstat (limited to 'net/http.lua')
-rw-r--r--net/http.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/http.lua b/net/http.lua
index da5b3c84..0da28f2e 100644
--- a/net/http.lua
+++ b/net/http.lua
@@ -142,7 +142,14 @@ function request(u, ex, callback)
return nil, err;
end
- req.write((req.method or "GET ")..req.path.." HTTP/1.0\r\n");
+ local request_line = { req.method or "GET", " ", req.path, " HTTP/1.1\r\n" };
+
+ if req.query then
+ t_insert(request_line, 4, "?");
+ t_insert(request_line, 5, req.query);
+ end
+
+ req.write(t_concat(request_line));
local t = { [2] = ": ", [4] = "\r\n" };
if custom_headers then
for k, v in pairs(custom_headers) do