diff --git a/include/types/proto_http.h b/include/types/proto_http.h index 0e51412a1..fc8647593 100644 --- a/include/types/proto_http.h +++ b/include/types/proto_http.h @@ -534,11 +534,13 @@ struct http_method_name { struct http_req_action_kw { const char *kw; int (*parse)(const char **args, int *cur_arg, struct proxy *px, struct http_req_rule *rule, char **err); + int match_pfx; }; struct http_res_action_kw { const char *kw; int (*parse)(const char **args, int *cur_arg, struct proxy *px, struct http_res_rule *rule, char **err); + int match_pfx; }; struct http_req_action_kw_list { diff --git a/include/types/proto_tcp.h b/include/types/proto_tcp.h index a6af2d37e..d34ff035c 100644 --- a/include/types/proto_tcp.h +++ b/include/types/proto_tcp.h @@ -65,6 +65,7 @@ struct tcp_action_kw { const char *kw; int (*parse)(const char **args, int *cur_arg, struct proxy *px, struct tcp_rule *rule, char **err); + int match_pfx; }; struct tcp_action_kw_list { diff --git a/src/proto_http.c b/src/proto_http.c index def5670bb..5b06233c6 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -12809,6 +12809,9 @@ struct http_req_action_kw *action_http_req_custom(const char *kw) list_for_each_entry(kw_list, &http_req_keywords.list, list) { for (i = 0; kw_list->kw[i].kw != NULL; i++) { + if (kw_list->kw[i].match_pfx && + strncmp(kw, kw_list->kw[i].kw, strlen(kw_list->kw[i].kw)) == 0) + return &kw_list->kw[i]; if (!strcmp(kw, kw_list->kw[i].kw)) return &kw_list->kw[i]; } @@ -12828,6 +12831,9 @@ struct http_res_action_kw *action_http_res_custom(const char *kw) list_for_each_entry(kw_list, &http_res_keywords.list, list) { for (i = 0; kw_list->kw[i].kw != NULL; i++) { + if (kw_list->kw[i].match_pfx && + strncmp(kw, kw_list->kw[i].kw, strlen(kw_list->kw[i].kw)) == 0) + return &kw_list->kw[i]; if (!strcmp(kw, kw_list->kw[i].kw)) return &kw_list->kw[i]; } diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 4a4a806d1..036191b48 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -145,6 +145,9 @@ static struct tcp_action_kw *tcp_req_conn_action(const char *kw) list_for_each_entry(kw_list, &tcp_req_conn_keywords, list) { for (i = 0; kw_list->kw[i].kw != NULL; i++) { + if (kw_list->kw[i].match_pfx && + strncmp(kw, kw_list->kw[i].kw, strlen(kw_list->kw[i].kw)) == 0) + return &kw_list->kw[i]; if (!strcmp(kw, kw_list->kw[i].kw)) return &kw_list->kw[i]; } @@ -162,6 +165,9 @@ static struct tcp_action_kw *tcp_req_cont_action(const char *kw) list_for_each_entry(kw_list, &tcp_req_cont_keywords, list) { for (i = 0; kw_list->kw[i].kw != NULL; i++) { + if (kw_list->kw[i].match_pfx && + strncmp(kw, kw_list->kw[i].kw, strlen(kw_list->kw[i].kw)) == 0) + return &kw_list->kw[i]; if (!strcmp(kw, kw_list->kw[i].kw)) return &kw_list->kw[i]; } @@ -179,6 +185,9 @@ static struct tcp_action_kw *tcp_res_cont_action(const char *kw) list_for_each_entry(kw_list, &tcp_res_cont_keywords, list) { for (i = 0; kw_list->kw[i].kw != NULL; i++) { + if (kw_list->kw[i].match_pfx && + strncmp(kw, kw_list->kw[i].kw, strlen(kw_list->kw[i].kw)) == 0) + return &kw_list->kw[i]; if (!strcmp(kw, kw_list->kw[i].kw)) return &kw_list->kw[i]; }