# HG changeset patch # User Matthew Wild # Date 1594126345 -3600 # Node ID e2ce067bb59a1443a92c32244fa684464a08c49b # Parent f4215f8baa5d965fadfe6804dae088b38b518d6f net.http: Fix traceback on invalid URL passed to request() diff -r f4215f8baa5d -r e2ce067bb59a net/http.lua --- a/net/http.lua Tue Jun 23 15:43:57 2020 +0200 +++ b/net/http.lua Tue Jul 07 13:52:25 2020 +0100 @@ -183,14 +183,15 @@ 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