net/http.lua
changeset 10999 e18a913aed2d
parent 10807 71d04bd6cadd
parent 10998 e2ce067bb59a
child 11021 1f41f38a92f7
--- a/net/http.lua	Thu Jul 02 19:03:59 2020 +0200
+++ b/net/http.lua	Tue Jul 07 13:52:45 2020 +0100
@@ -185,14 +185,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