From b6f3c19a9f78ac1c2ac90dc7b2fd36f7b77308f3 Mon Sep 17 00:00:00 2001 From: Christos Tsantilas Date: Wed, 4 Mar 2020 16:26:01 +0000 Subject: [PATCH] Supply ALE to request_header_add/reply_header_add (#564) Supply ALE to request_header_add and reply_header_add ACLs that need it (e.g., external, annotate_client, and annotate_transaction ACLs). Fixes "ACL is used in context without an ALE state" errors when external ACLs are used in the same context (other ACLs do not yet properly disclose that they need ALE). Also provides HTTP reply to reply_header_add ACLs. This is a Measurement Factory project. --- src/HttpHeaderTools.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/HttpHeaderTools.cc b/src/HttpHeaderTools.cc index 93d5039225..ab84a20a5f 100644 --- a/src/HttpHeaderTools.cc +++ b/src/HttpHeaderTools.cc @@ -484,6 +484,12 @@ httpHdrAdd(HttpHeader *heads, HttpRequest *request, const AccessLogEntryPointer { ACLFilledChecklist checklist(NULL, request, NULL); + checklist.al = al; + if (al && al->reply) { + checklist.reply = al->reply.getRaw(); + HTTPMSGLOCK(checklist.reply); + } + for (HeaderWithAclList::const_iterator hwa = headersAdd.begin(); hwa != headersAdd.end(); ++hwa) { if (!hwa->aclList || checklist.fastCheck(hwa->aclList).allowed()) { const char *fieldValue = NULL; -- 2.47.2