]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: deviceatlas: use the result's property type when printing
authorDavid Carlier <dcarlier@deviceatlas.com>
Tue, 20 Oct 2026 14:59:05 +0000 (15:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 26 Oct 2026 10:36:26 +0000 (11:36 +0100)
da_haproxy() took the property type from the atlas catalogue, but a result
may carry a different type for a property, e.g. a client-side property from
the cookie. The typed getter then failed and the value was printed empty.
The type is now read from the result with da_getproptype().

This should be backported to lower branches.

addons/deviceatlas/da.c

index d1080b41408cbc76206a6628c70f064d5c15b887..afcf2d3183802f48242fe8091eadd101423a55fd 100644 (file)
@@ -380,7 +380,7 @@ static int da_haproxy(const struct arg *args, struct sample *smp, da_deviceinfo_
                        chunk_appendf(tmp, "%c", global_deviceatlas.separator);
                        continue;
                }
-               if (unlikely(da_atlas_getproptype(&global_deviceatlas.atlas, prop, &proptype) != DA_OK)) {
+               if (unlikely(da_getproptype(devinfo, prop, &proptype) != DA_OK)) {
                        chunk_appendf(tmp, "%c", global_deviceatlas.separator);
                        continue;
                }