]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Supply ALE to request_header_add/reply_header_add (#564)
authorChristos Tsantilas <christos@chtsanti.net>
Wed, 4 Mar 2020 16:26:01 +0000 (16:26 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 6 Mar 2020 16:27:56 +0000 (16:27 +0000)
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

index 93d5039225e1ecf80afea7dde4e82dec212ad9e8..ab84a20a5fc40031d153942d1837213db4e1fd74 100644 (file)
@@ -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;