if (!rule)
goto out_of_memory;
rule->cond = cond;
+ rule->type = type;
+ rule->code = code;
+ rule->flags = flags;
+ LIST_INIT(&rule->list);
lf_expr_init(&rule->rdr_fmt);
if (!use_fmt) {
cap |= (dir ? SMP_VAL_FE_HRS_HDR : SMP_VAL_FE_HRQ_HDR);
if (curproxy->cap & PR_CAP_BE)
cap |= (dir ? SMP_VAL_BE_HRS_HDR : SMP_VAL_BE_HRQ_HDR);
- if (!(type == REDIRECT_TYPE_PREFIX && destination[0] == '/' && destination[1] == '\0')) {
+ if (!(rule->type == REDIRECT_TYPE_PREFIX && destination[0] == '/' && destination[1] == '\0')) {
if (!parse_logformat_string(destination, curproxy, &rule->rdr_fmt, LOG_OPT_HTTP, cap, errmsg)) {
goto err;
}
else if (cookie_set == 2) { // set-cookie-fmt
int cap = 0;
+ rule->flags |= REDIRECT_FLAG_COOKIE_FMT;
+
lf_expr_init(&rule->cookie.fmt);
curproxy->conf.args.ctx = ARGC_RDR;
if (curproxy->cap & PR_CAP_FE)
if (!parse_logformat_string(trash.area, curproxy, &rule->cookie.fmt, LOG_OPT_HTTP, cap, errmsg)) {
goto err;
}
-
- flags |= REDIRECT_FLAG_COOKIE_FMT;
}
else { // clear-cookie
rule->cookie.str = istalloc(cookie_len+20);
istcat(&rule->cookie.str, ist2("; path=/; Max-Age=0;", 20), cookie_len+21);
}
}
- rule->type = type;
- rule->code = code;
- rule->flags = flags;
- LIST_INIT(&rule->list);
+
return rule;
missing_arg: