Is it possible to get http response code in http-response lua func call?

Greetings!
Is it possible to get http response code in http-response lua func call ? I found a way how to override, but not how to get. txn.res looks like a way out but still need some parsing.

Thanks in advance for your answers.

txn.res fail
Lua function ‘post_rp_route’: [state-id 0] runtime error: Cannot manipulate HAProxy channels in HTTP mode. from [C]: in method ‘getline’, /etc/haproxy/lua/register.lua:46: in function line 43.

Replying here just to get a notification when this question gets any answers!!!

The status can be obtaived via txn.f:status()

1 Like

Thanks, @iye I am going to try it and will share the result.