Looks like asterisk is only allowed at the end.

You might want to make it router.get("*", &failHandler); and implement a regex check in your fail handler

(req, res) { enforceHTTP(regex.match("/.jpg/") ...