diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-01-15 04:08:06 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-01-15 04:08:06 +0000 |
commit | 661b30bfc70217b74f21182ac708befae93cfaf0 (patch) | |
tree | 44529aab464a668c9426550d46de1b5e4ad2e87f | |
parent | 60886540232400adc81e712f5026e0d6f2cfbf07 (diff) | |
download | prosody-661b30bfc70217b74f21182ac708befae93cfaf0.tar.gz prosody-661b30bfc70217b74f21182ac708befae93cfaf0.zip |
net.http: Fix to send query part of URL to server
-rw-r--r-- | net/http.lua | 9 |
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 |