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.
This commit is contained in:
Frdric Lcaille 2018-11-06 10:55:34 +01:00 committed by Willy Tarreau
parent 42d9e5ae68
commit a985e3875b
2 changed files with 5 additions and 2 deletions

View File

@ -77,6 +77,7 @@ enum act_name {
ACT_HTTP_DEL_ACL,
ACT_HTTP_DEL_MAP,
ACT_HTTP_SET_MAP,
ACT_HTTP_EARLY_HINT,
/* http request actions. */
ACT_HTTP_REQ_TARPIT,

View File

@ -208,8 +208,10 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
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] ||