Make pcre_extend work, and cover PCRE filtering with tests

The filter walked its list of access rules but tested the first entry each
time round, so anything pcre_extend appended was never consulted and the
command did nothing at all. Test the entry the loop is on.

pcre_extend takes an ACE and no FILTER_ACTION - the rule keeps the action it
was given - so correct the manual, which documented an argument the command
does not read.

The tests cover matching and denial, rule order, client headers, matching
options, the access rule a pcre rule carries, pcre_extend, and rewriting a
reply header and reply data. Request rewriting is covered through an HTTP
parent, which is the path where it reaches the wire.
This commit is contained in:
Vladimir Dubrovin committed 2026-08-26 10:16:12 +03:00
1 parent fc544c4dff
commit cdbd47dc5b
3 files changed
+115 -2

No files matched your search

+1 -1
View File
@@ -277,7 +277,7 @@ static FILTER_ACTION pcre_filter_buffer(void *fc, struct clientparam *param, uns
#define pcrefd ((struct pcre_filter_data *)fc)
for(acl = pcrefd->acl; acl; acl=acl->next){
if(pl->ACLMatches(pcrefd->acl, param)){
if(pl->ACLMatches(acl, param)){
match = 1;
break;
}