MINOR: http: Add new "early-hint" http-request action.
This patch adds the new "early-hint" action to "http-request" rules parser.
This action should be parsed the same way as "(add|set)-header" actions.
diff --git a/include/types/action.h b/include/types/action.h
index 04a9f18..b24ce21 100644
--- a/include/types/action.h
+++ b/include/types/action.h
@@ -77,6 +77,7 @@
ACT_HTTP_DEL_ACL,
ACT_HTTP_DEL_MAP,
ACT_HTTP_SET_MAP,
+ ACT_HTTP_EARLY_HINT,
/* http request actions. */
ACT_HTTP_REQ_TARPIT,
diff --git a/src/http_rules.c b/src/http_rules.c
index ce67240..87117bf 100644
--- a/src/http_rules.c
+++ b/src/http_rules.c
@@ -208,8 +208,10 @@
else if ((rule->arg.loglevel = get_log_level(args[cur_arg]) + 1) == 0)
goto bad_log_level;
cur_arg++;
- } else if (strcmp(args[0], "add-header") == 0 || strcmp(args[0], "set-header") == 0) {
- rule->action = *args[0] == 'a' ? ACT_HTTP_ADD_HDR : ACT_HTTP_SET_HDR;
+ } else if (strcmp(args[0], "add-header") == 0 || strcmp(args[0], "set-header") == 0 ||
+ strcmp(args[0], "early-hint") == 0) {
+ rule->action = *args[0] == 'a' ? ACT_HTTP_ADD_HDR :
+ *args[0] == 's' ? ACT_HTTP_SET_HDR : ACT_HTTP_EARLY_HINT;
cur_arg = 1;
if (!*args[cur_arg] || !*args[cur_arg+1] ||