]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: map: add map_*_key converters to provide the matching key
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 19 Dec 2023 10:49:05 +0000 (11:49 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Dec 2023 13:22:27 +0000 (14:22 +0100)
commitca4758378788ee6a9b774590badbaa12d356e186
treed52ed1e7537ebea0d9c562836451f1692c113ccd
parent9b2717e7bb754c75816fb9272f3a2bcd6ea258cf
MINOR: map: add map_*_key converters to provide the matching key

All map_*_ converters now have an additional output type: key. Such
converters will return the matched entry's key (as found in the map file)
as a string instead of the value.

Consider this example map file:
 |example.com value1
 |haproxy value2

With the above map file:

str(test.example.com/url),map_dom_key(file.map) will return "example.com"
str(running haproxy),map_sub_key(file.map) will return "haproxy"

This should address GH #1446.
doc/configuration.txt
src/map.c