This reverts commit
4b9c0d1fc08388bf44c6ebbd88f786032dd010fc.
Actually, the "replace-path" action is ambiguous. "set-path" action preserves
the query-string. The "path" sample fetch does not contain the query-string. But
"replace-path" action is documented to handle the query-string. It is probably
not the expected behavior. So instead of fixing the code, we will fix the
documentation to make "replace-path" action consistent with other parts of the
code. In addition actions and sample fetches to handle the path with the
query-string will be added.
If the commit above is ever backported, this one must be as well.
(cherry picked from commit
1fa0cc18e1c6dd5460492128b5b400d808f3c823)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit
34b0840ec15e9c869f1bcbdfb4cfca119cb7a874)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
goto leave;
uri = htx_sl_req_uri(http_get_stline(htxbuf(&s->req.buf)));
- if (rule->arg.act.p[0] == (void *)4)
- uri = http_get_path(uri);
+ if (rule->arg.act.p[0] == (void *)1)
+ uri = iststop(http_get_path(uri), '?');
if (!regex_exec_match2(rule->arg.act.p[1], uri.ptr, uri.len, MAX_MATCH, pmatch, 0))
goto leave;
rule->action = ACT_CUSTOM;
if (strcmp(args[cur_arg-1], "replace-path") == 0)
- rule->arg.act.p[0] = (void *)4; // replace-path
+ rule->arg.act.p[0] = (void *)1; // replace-path
else
rule->arg.act.p[0] = (void *)3; // replace-uri
return -1;
break;
- case 4: // path + query
- if (!http_replace_req_path(htx, ist2(replace, len), 1))
- return -1;
- break;
-
default:
return -1;
}