HTTP Access Control helper based on http://flask.pocoo.org/snippets/56/