# HG changeset patch # User Matthew Wild # Date 1313867334 14400 # Node ID 3f414091a008cce259e78f57604dc23ac68c8563 # Parent 0b9ed126286e1827d6543237d97a7ab767e1b7da net.http: Whitespace fixes diff -r 0b9ed126286e -r 3f414091a008 net/http.lua --- a/net/http.lua Sat Aug 20 15:08:21 2011 -0400 +++ b/net/http.lua Sat Aug 20 15:08:54 2011 -0400 @@ -6,7 +6,6 @@ -- COPYING file in the source package for more information. -- - local socket = require "socket" local mime = require "mime" local url = require "socket.url" @@ -105,7 +104,7 @@ if req.userinfo then default_headers["Authorization"] = "Basic "..mime.b64(req.userinfo); end - + if ex then custom_headers = ex.headers; req.onlystatus = ex.onlystatus; @@ -115,7 +114,12 @@ default_headers["Content-Length"] = tostring(#body); default_headers["Content-Type"] = "application/x-www-form-urlencoded"; end - if ex.method then req.method = ex.method; end + if ex.method then method = ex.method; end + if ex.headers then + for k, v in pairs(ex.headers) do + headers[k] = v; + end + end end req.handler, req.conn = server.wrapclient(socket.tcp(), req.host, req.port or 80, listener, "*a"); @@ -158,7 +162,7 @@ req.callback = function (content, code, request) log("debug", "Calling callback, status %s", code or "---"); return select(2, xpcall(function () return callback(content, code, request) end, handleerr)); end req.reader = request_reader; req.state = "status"; - + listener.register_request(req.handler, req); return req;