Le 12/4/21 à 13:25, Aleksandar Lazic a écrit :

Hi.

I try to capture the response header "dst_conn" from "http-request return" but 
in %hs isn't the value.

```
podman logs -f haproxy-dest
[NOTICE]   (1) : New worker #1 (3) forked
<6>[04/Dec/2021:12:14:34.437] 200 58 - - LR-- {} "GET / HTTP/1.1"
<6>[04/Dec/2021:12:14:34.437] 200 58 - - LR-- {} "GET / HTTP/1.1"
<6>[04/Dec/2021:12:14:34.438] 200 58 - - LR-- {} "GET / HTTP/1.1"

```

I haven't seen any "capture" in "http-after-response".
The question is also makes sense to have a capture after "http-request return" 
as in the documenation is
written that return stops the evaluation of any other rules also from capture?

http://cbonte.github.io/haproxy-dconv/2.4/configuration.html#http-response%20return
"This stops the evaluation of the rules and immediately returns a response."

Hi Alex,

Unfortunately, it is indeed not possible for now. First, the captures via "capture request" and "capture response" directives are performed very early, and on received messages only. Thus it is not possible to capture info from generated responses at this stage. However, it is probably possible to add a "capture" action to the "http-afer-response" ruleset. This would able to you to capture your header with the following config:

   declare capture response len 4
   http-after-response capture hdr(dst_conn) id 0

At first glance it seems trivial. I will check that.

--
Christopher Faulet

Reply via email to