mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
For a very long time it used to be impossible to pass a closing square bracket as a valid character in argument to a sample fetch function or to a converter because the LF parser used to stop on the first such character found and to pass what was between the first '[' and the first ']' to sample_parse_expr(). This patch addresses this by passing the whole string to sample_parse_expr() which is the only one authoritative to indicate the first character that does not belong to the expression. The LF parser then verifies it matches a ']' or fails. As a result it is finally possible to write rules such as the following, which is totally valid an unambigous : http-request redirect location %[url,regsub([.:/?-],!,g)] |-----| | | arg1 | `---> arg3 `-----> arg2 |-----------------| converter |---------------------| sample expression |------------------------| log-format tag