From c340e3ab373d32fd909e5902538031ed30d9585f Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 25 Aug 2020 15:59:04 +0100 Subject: net.http: http.request() promise now resolves with response (breaking change) Promise mode is not (widely?) used, changing this now while we can, as it improves usability of the API. The request is now available as response.request, if needed. --- net/http.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'net/http.lua') diff --git a/net/http.lua b/net/http.lua index 2deeae14..c417ebec 100644 --- a/net/http.lua +++ b/net/http.lua @@ -293,7 +293,8 @@ local function new(options) if code == 0 then reject(http_errors.new(body, { request = a })); else - resolve({ request = b, response = a }); + a.request = b; + resolve(a); end end); end); -- cgit v1.2.3