Comparison

net/http.lua @ 8706:e2919978673e

net.http: Fix parameter order to http request callbacks Commit e3b9dc9dd940 changed the parameter order in 2013, but did not update the names of the parameters in the callback function. Due to this inconsistency, 12df41a5a4b1 accidentally reversed the order when fixing the variable names without fixing where they are used. Additionally the documentation was incorrect (since 2013), and this has also now been fixed.
author Matthew Wild <mwild1@gmail.com>
date Wed, 04 Apr 2018 18:27:44 +0100
parent 8200:e92585ab4998
child 8707:fd39c44c0113
child 8730:de74bc49385e
comparison
equal deleted inserted replaced
8705:1d66f66a13c9 8706:e2919978673e
236 self.events.fire_event("response", event); 236 self.events.fire_event("response", event);
237 content, code, response = event.content, event.code, event.response; 237 content, code, response = event.content, event.code, event.response;
238 end 238 end
239 239
240 log("debug", "Request '%s': Calling callback, status %s", req.id, code or "---"); 240 log("debug", "Request '%s': Calling callback, status %s", req.id, code or "---");
241 return log_if_failed(req.id, xpcall(function () return callback(content, code, request, response) end, handleerr)); 241 return log_if_failed(req.id, xpcall(function () return callback(content, code, response, request) end, handleerr));
242 end 242 end
243 req.reader = request_reader; 243 req.reader = request_reader;
244 req.state = "status"; 244 req.state = "status";
245 245
246 requests[req.handler] = req; 246 requests[req.handler] = req;