httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <>
Subject Expr's lists evaluated in a string context (was: [users@httpd] mod_lua and subprocess_env)
Date Wed, 22 Feb 2017 15:51:39 GMT
> On Tue, Feb 21, 2017 at 6:32 PM, Yann Ylavic <> wrote:
>> Header set Client-SAN "expr=%{PeerExtList:}"

This currently fails because list functions are not recognized in a
string context.

For now, lists can be either expressed with the syntax "{ <word>,
<word>, ... }", with <word> being itself something powerful, or
obtained from the mod_ssl's PeerExtList() function (grab anything from
a peer certificate).

For the latter case (or for future functions), it could be useful to
be able to work on such strings (e.g. with extracting regexes).
So I wonder if we could return the string elements separated by
something in the case of lists evaluated in a string context.

For example, the attached patch uses the seprator ", " (quite HTTP
field inspired), but it could be a json string or whatever...
We could also have an explicit tostring/tojson() function which would
stringify anything as argument.

Or yet more operators on lists, like list_empty(), list_first(),
list_last(), list_nth(), list_match(<list>, <regex>) (returning
another list of matching entries), ... you name it.

Working on anything from a certificates looks very useful at least.


View raw message