]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: acl: set "str" as default match for strings
authorThierry FOURNIER <tfournier@exceliance.fr>
Sun, 11 May 2014 13:15:00 +0000 (15:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 12 May 2014 13:19:15 +0000 (15:19 +0200)
It appears than many people considers that the default match for a fetch
returning string is "exact match string" aka "str". This patch set this
match as default for strings.

src/acl.c

index 7d1736ef92fc87a7839cc56583f0f4cdaed3a7dc..69da28d7e9357ac30afcee88657476969c6ac2fa 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -415,6 +415,14 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *
                        expr->pat.prune = pat_prune_fcts[PAT_MATCH_IP];
                        expr->pat.expect_type = pat_match_types[PAT_MATCH_IP];
                        break;
+               case SMP_T_STR:
+                       expr->pat.parse = pat_parse_fcts[PAT_MATCH_STR];
+                       expr->pat.index = pat_index_fcts[PAT_MATCH_STR];
+                       expr->pat.match = pat_match_fcts[PAT_MATCH_STR];
+                       expr->pat.delete = pat_delete_fcts[PAT_MATCH_STR];
+                       expr->pat.prune = pat_prune_fcts[PAT_MATCH_STR];
+                       expr->pat.expect_type = pat_match_types[PAT_MATCH_STR];
+                       break;
                }
        }