haproxy/reg-tests/http-rules
Willy Tarreau bc1223be79 MINOR: http-rules: add a new "ignore-empty" option to redirects.
Sometimes it is convenient to remap large sets of URIs to new ones (e.g.
after a site migration for example). This can be achieved using
"http-request redirect" combined with maps, but one difficulty there is
that non-matching entries will return an empty response. In order to
avoid this, duplicating the operation as an ACL condition ending in
"-m found" is possible but it becomes complex and error-prone while it's
known that an empty URL is not valid in a location header.

This patch addresses this by improving the redirect rules to be able to
simply ignore the rule and skip to the next one if the result of the
evaluation of the "location" expression is empty. However in order not
to break existing setups, it requires a new "ignore-empty" keyword.

There used to be an ACT_FLAG_FINAL on redirect rules that's used during
the parsing to emit a warning if followed by another rule, so here we
only set it if the option is not there. The http_apply_redirect_rule()
function now returns a 3rd value to mention that it did nothing and
that this was not an error, so that callers can just ignore the rule.
The regular "redirect" rules were not modified however since this does
not apply there.

The map_redirect VTC was completed with such a test and updated to 2.5
and an example was added into the documentation.
2021-09-02 17:06:18 +02:00
..
1k.txt REGTESTS: Add reg tests for the HTTP return action 2020-02-06 15:13:04 +01:00
acl_cli_spaces.vtc CLEANUP: reg-tests: Remove obsolete no-htx parameter for reg-tests 2021-06-04 15:41:21 +02:00
agents.acl REGTEST: http-rules: test spaces in ACLs 2020-06-19 14:32:55 +02:00
converters_ipmask_concat_strcmp_field_word.map REGTEST: rename the reg test files. 2019-04-23 15:37:03 +02:00
converters_ipmask_concat_strcmp_field_word.vtc CLEANUP: reg-tests: Remove obsolete no-htx parameter for reg-tests 2021-06-04 15:41:21 +02:00
del_header.vtc MINOR: http_act: Add -m flag for del-header name matching method 2020-11-21 15:54:30 +01:00
except-forwardfor-originalto.vtc REGTESTS: disable inter-thread idle connection sharing on sensitive tests 2021-05-09 14:41:41 +02:00
h1_to_h1c.vtc REGTESTS: Remove REQUIRE_VERSION=1.6 from all tests 2021-06-11 19:21:28 +02:00
h1or2_to_h1c.vtc CLEANUP: reg-tests: Remove obsolete no-htx parameter for reg-tests 2021-06-04 15:41:21 +02:00
http_after_response.vtc REGTESTS: Add a reg test for http-after-response rulesets 2020-02-06 15:13:04 +01:00
http_return.vtc REGTESTS: disable inter-thread idle connection sharing on sensitive tests 2021-05-09 14:41:41 +02:00
lf-file.txt REGTESTS: Add reg tests for the HTTP return action 2020-02-06 15:13:04 +01:00
map_redirect-be.map REGTEST: rename the reg test files. 2019-04-23 15:37:03 +02:00
map_redirect.map MINOR: http-rules: add a new "ignore-empty" option to redirects. 2021-09-02 17:06:18 +02:00
map_redirect.vtc MINOR: http-rules: add a new "ignore-empty" option to redirects. 2021-09-02 17:06:18 +02:00
map_regm_with_backref.map REGTEST: rename the reg test files. 2019-04-23 15:37:03 +02:00
map_regm_with_backref.vtc REGTESTS: Remove REQUIRE_VERSION=1.7 from all tests 2021-06-11 19:21:28 +02:00
normalize_uri.vtc MINOR: uri_normalizer: Add fragment-encode normalizer 2021-05-11 17:24:32 +02:00
path_and_pathq.vtc REGTEST: Add a test for request path manipulations, with and without the QS 2020-09-04 11:41:47 +02:00
strict_rw_mode.vtc REGTEST: Add a strict rewriting mode reg test 2020-01-20 15:19:55 +01:00