Software / code / prosody
Comparison
net/http.lua @ 10995:e18a913aed2d
Merge 0.11->trunk
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 07 Jul 2020 13:52:45 +0100 |
| parent | 10803:71d04bd6cadd |
| parent | 10994:e2ce067bb59a |
| child | 11017:1f41f38a92f7 |
comparison
equal
deleted
inserted
replaced
| 10993:b5e7f4d533e2 | 10995:e18a913aed2d |
|---|---|
| 183 req.callback(reason or "connection failed", 0, req); | 183 req.callback(reason or "connection failed", 0, req); |
| 184 end | 184 end |
| 185 | 185 |
| 186 local function request(self, u, ex, callback) | 186 local function request(self, u, ex, callback) |
| 187 local req = url.parse(u); | 187 local req = url.parse(u); |
| 188 req.url = u; | |
| 189 req.http = self; | |
| 190 | 188 |
| 191 if not (req and req.host) then | 189 if not (req and req.host) then |
| 192 callback("invalid-url", 0, req); | 190 callback("invalid-url", 0, req); |
| 193 return nil, "invalid-url"; | 191 return nil, "invalid-url"; |
| 194 end | 192 end |
| 193 | |
| 194 req.url = u; | |
| 195 req.http = self; | |
| 195 | 196 |
| 196 if not req.path then | 197 if not req.path then |
| 197 req.path = "/"; | 198 req.path = "/"; |
| 198 end | 199 end |
| 199 | 200 |