* Cleans up sloppy URLs on the request object, * like `/foo////bar///` to `/foo/bar`. * * @public * @function sanitizePath * @returns {Function} Handler
()
| 43 | * @returns {Function} Handler |
| 44 | */ |
| 45 | function sanitizePath() { |
| 46 | function _sanitizePath(req, res, next) { |
| 47 | req.url = strip(req.url); |
| 48 | next(); |
| 49 | } |
| 50 | |
| 51 | return _sanitizePath; |
| 52 | } |
| 53 | |
| 54 | ///--- Exports |
| 55 |