(req)
| 28 | * @return {string} Fully qualified URL of the request |
| 29 | */ |
| 30 | export function fullUrlForReq (req) { |
| 31 | const fullUrl = url.format({ |
| 32 | protocol: req.protocol, |
| 33 | host: req.get('host'), |
| 34 | pathname: url.resolve(req.baseUrl, req.path), |
| 35 | query: req.query |
| 36 | }) |
| 37 | |
| 38 | return fullUrl |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Removes the `<` and `>` brackets around a string and returns it. |