MINOR: sample: Add iif(<true>,<false>) converter
authorTim Duesterhus <duesterhus@woltlab.com>
Fri, 11 Sep 2020 12:25:23 +0000 (14:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 11 Sep 2020 14:59:27 +0000 (16:59 +0200)
commit3943e4fc3e8bbfeb5a210c8e86ff0ed53a3bbcc4
treefa420eb1948286bd6ece12d2f51554f6792ad835
parent00c363ba9d2c98af518ff94900bddc38b909b081
MINOR: sample: Add iif(<true>,<false>) converter

iif() takes a boolean as input and returns one of the two argument
strings depending on whether the boolean is true.

This converter most likely is most useful to return the proper scheme
depending on the value returned by the `ssl_fc` fetch, e.g. for use within
the `x-forwarded-proto` request header.

However it can also be useful for use within a template that is sent to
the client using `http-request return` with a `lf-file`. It allows the
administrator to implement a simple condition, without needing to prefill
variables within the regular configuration using `http-request
set-var(req.foo)`.
doc/configuration.txt
reg-tests/converter/iif.vtc [new file with mode: 0644]
src/sample.c