{
    "description": "Necessary Fastly configuration to enable Blackfire profiling.",
    "id": "blackfire_integration",
    "name": "Blackfire integration",
    "properties": [
        {
            "description": "ACL that contains IPs of users allowing to profile",
            "label": "ACL",
            "name": "Acl",
            "required": true,
            "type": "acl"
        }
    ],
    "test": {
        "origins": [
            "https://httpbin.org"
        ],
        "reqUrl": "/status/500"
    },
    "vcl": [
        {
            "priority": 70,
            "template": "   if (req.http.X-Blackfire-Query && req.http.Fastly-Client-IP ~ {{Acl}}) {\r\n     if (req.esi_level > 0) {\r\n        # ESI request should not be included in the profile.\r\n        # Instead you should profile them separately, each one\r\n        # in their dedicated profile.\r\n        # Removing the Blackfire header avoids to trigger the profiling.\r\n        # Not returning let it go through your usual workflow as a regular\r\n        # ESI request without distinction.\r\n        unset req.http.X-Blackfire-Query;\r\n     } else {\r\n        set req.http.X-Pass = \"1\";\r\n     }\r\n   }",
            "type": "recv"
        }
    ],
    "version": 1
}
