BUG/MINOR: contrib/prometheus-exporter: decode parameter and value only
authorWilliam Dauchy <w.dauchy@criteo.com>
Tue, 26 Nov 2019 11:56:26 +0000 (12:56 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 27 Nov 2019 13:25:38 +0000 (14:25 +0100)
commit8ec21c5fef89f13fea2ac9be55d55215d4b9104a
tree07ea905be306db3e5f3991786aa9fa3d5c792a6f
parente54b43af1ec9dc656c04b09118583cb3c2ce56fa
BUG/MINOR: contrib/prometheus-exporter: decode parameter and value only

we were decoding all substring and then parsing; this could lead to
consider & and = in decoding result as delimiters where it should not.
this patch reverses the order by first parsing and then decoding each key
and value separately.

we also stop parsing after number sign (#).

This patch should be backported to 2.1 and 2.0

Signed-off-by: William Dauchy <w.dauchy@criteo.com>
(cherry picked from commit c65f656d75091db3087a752dbc956159392fc8f2)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
contrib/prometheus-exporter/service-prometheus.c