Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.serve_image = function (req, resp) {
var m = /^\/(src|thumb|mid|vint)(\/\d+\.\w+)$/.exec(req.url);
if (!m)
return false;
var root = config.MEDIA_DIRS[m[1]];
if (!root)
return false;
require('send')(req, m[2], {root: root}).pipe(resp);
return true;
};