I am seeing what I believe is a bug when converters are used with http-request 
replace-header.
I have the following configuration:

global
        maxconn 5

defaults
        mode http
        timeout connect 30s
        timeout client 1m
        timeout server 1m

listen test
        bind :80
        
        acl param_found urlp(cookievalue) -m found
        acl cookies_found req.hdr(Cookie) -m found
        http-request replace-header Cookie (.*) 
\1;test=%[urlp(cookievalue),url_dec] if param_found cookies_found
        http-request set-header Cookie test=%[urlp(cookievalue),url_dec] if 
param_found !cookies_found
        
        server server1 127.0.0.1:8080


I am running a simple echo server from npm on port 8080.

If I do “curl localhost/test?cookievalue=foo”, then I see the correct “Cookie: 
test=foo” in the request to the echo server. If I do “curl -H ‘Cookie: x=y’ 
localhost/test?cookievalue=foo" then the cookie header I passed is wiped out 
and I see only an empty cookie header in the request to the echo server. If I 
remove “,url_dec” from the replace-header statement, then both cases work.

Did I miss something in the docs, or should this configuration work (which 
would mean there is a bug)? Thanks!


Reply via email to