mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-22 04:10:48 +00:00
bc1223be79
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. |
||
---|---|---|
.. | ||
1k.txt | ||
acl_cli_spaces.vtc | ||
agents.acl | ||
converters_ipmask_concat_strcmp_field_word.map | ||
converters_ipmask_concat_strcmp_field_word.vtc | ||
del_header.vtc | ||
except-forwardfor-originalto.vtc | ||
h1_to_h1c.vtc | ||
h1or2_to_h1c.vtc | ||
http_after_response.vtc | ||
http_return.vtc | ||
lf-file.txt | ||
map_redirect-be.map | ||
map_redirect.map | ||
map_redirect.vtc | ||
map_regm_with_backref.map | ||
map_regm_with_backref.vtc | ||
normalize_uri.vtc | ||
path_and_pathq.vtc | ||
strict_rw_mode.vtc |