def after_request(response):
    """Grafana makes POST requests for queries, which aren't on the same domain/port
    from which you're serving the Grafana instance. Therefore we must add the headers
    so the browser will approve the cross domain request. Flask automatically deals
    with OPTIONS requests, which uses the same headers here."""
    response.headers.add('Access-Control-Allow-Origin', '*')
    response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
    response.headers.add('Access-Control-Allow-Methods', 'GET,POST,OPTIONS')
    return response