# HG changeset patch # User Matthew Wild # Date 1231992486 0 # Node ID b1eb112478b866871cdc835210725e1644129f6e # Parent aa78dfb265938f2b3df87959508e0a7328b6d59d net.http: Fix to send query part of URL to server diff -r aa78dfb26593 -r b1eb112478b8 net/http.lua --- a/net/http.lua Thu Jan 15 04:36:35 2009 +0500 +++ b/net/http.lua Thu Jan 15 04:08:06 2009 +0000 @@ -142,7 +142,14 @@ 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