connect/express middleware to validate incoming http requests