Hi Aleks,
On Sun, Jul 23, 2017 at 09:50:41AM +0200, Aleksandar Lazic wrote:
> > Personally I use 2 rules similar to the following to append to
> > X-Forwarded-For:
> >
> > http-request set-header X-Forwarded-For
> > %[req.fhdr(X-Forwarded-For)],\ %[src] if { req.fhdr(X-Forwarded-For) -m
> > found }
> > http-request set-header X-Forwarded-For %[src] if !{
> > req.fhdr(X-Forwarded-For) -m found }
> >
> > -Patrick
>
> But doesn't haproxy do this already?
>
> http://git.haproxy.org/?p=haproxy-1.7.git;a=blob;f=src/proto_http.c;h=94c8d639f6f777241109f605e1e1742f9a39bf33;hb=HEAD#l4639
It always adds a new header field. But this is strictly equivalent to
adding a new value to an existing entry, it's just much less expensive
(no need to scan the list to find one, nor to move bytes around to insert
a new value).
Willy