On Thu, 4 Aug 2016 18:44:03 +0000 (UTC)
G H <uothr...@yahoo.com> wrote:

> I'm having some confusion modifying the HTTP response in Lua service. I have 
> the below:
> 
> core.register_action("headers", { "http-res" }, function(txn)
>     local data = txn.res:get()
>     while data ~= nil do
>         txn:Info(data)
>         txn.res:send(data)
>         data = txn.res:get()
>     end
> end)
> 
> 
> This doesn't seem to work at all, the HTTP client request is closed after the 
> HTTP headers are received with zero bytes received. 
> 
> 1) Why isn't get() returning the entire header+body content?


Hi,

The TXN.res and TXN.req allow to manipulate HAProxy buffers and not
HTTP, so the get() function returns all the content avalaible in the
buffer.

So, these functions doesn't exists for modifying http data.

Thierry


> 2) If not the above, why aren't subsequent calls to get() never succeeding? 
> Shouldn't the buffer write get refilled?
> 
> Thanks.
> 

Reply via email to