113 local function handleerr(err) log("error", "Traceback[http]: %s: %s", tostring(err), debug_traceback()); end |
113 local function handleerr(err) log("error", "Traceback[http]: %s: %s", tostring(err), debug_traceback()); end |
114 function request(u, ex, callback) |
114 function request(u, ex, callback) |
115 local req = url.parse(u); |
115 local req = url.parse(u); |
116 |
116 |
117 if not (req and req.host) then |
117 if not (req and req.host) then |
|
118 callback(nil, 0, req); |
118 return nil, "invalid-url"; |
119 return nil, "invalid-url"; |
119 end |
120 end |
120 |
121 |
121 if not req.path then |
122 if not req.path then |
122 req.path = "/"; |
123 req.path = "/"; |