Only set variables in the middleware and let application/router throw errors based on the version.