equal
deleted
inserted
replaced
162 local request_line = { req.method or "GET", " ", req.path, " HTTP/1.1\r\n" }; |
162 local request_line = { req.method or "GET", " ", req.path, " HTTP/1.1\r\n" }; |
163 if req.query then |
163 if req.query then |
164 t_insert(request_line, 4, "?"..req.query); |
164 t_insert(request_line, 4, "?"..req.query); |
165 end |
165 end |
166 |
166 |
|
167 for k, v in pairs(req.headers) do |
|
168 t_insert(request_line, k .. ": " .. v .. "\r\n"); |
|
169 end |
|
170 t_insert(request_line, "\r\n") |
167 conn:write(t_concat(request_line)); |
171 conn:write(t_concat(request_line)); |
168 local t = { [2] = ": ", [4] = "\r\n" }; |
|
169 for k, v in pairs(req.headers) do |
|
170 t[1], t[3] = k, v; |
|
171 conn:write(t_concat(t)); |
|
172 end |
|
173 conn:write("\r\n"); |
|
174 |
172 |
175 if req.body then |
173 if req.body then |
176 conn:write(req.body); |
174 conn:write(req.body); |
177 end |
175 end |
178 end |
176 end |