From b3512456a0649b28c4b85610170151893d49f795 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 7 Jul 2020 13:52:25 +0100 Subject: net.http: Fix traceback on invalid URL passed to request() --- net/http.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'net/http.lua') diff --git a/net/http.lua b/net/http.lua index fe5250ac..0adac26c 100644 --- a/net/http.lua +++ b/net/http.lua @@ -183,14 +183,15 @@ end local function request(self, u, ex, callback) local req = url.parse(u); - req.url = u; - req.http = self; if not (req and req.host) then callback("invalid-url", 0, req); return nil, "invalid-url"; end + req.url = u; + req.http = self; + if not req.path then req.path = "/"; end -- cgit v1.2.3