Return request headers in ext_proc after body is consumed

24 views
Skip to first unread message

Tomas Kolda

unread,
Jan 28, 2025, 6:11:30 AM1/28/25
to envoy-users
Hi,

I am writing external processor using GRPC interface. In simple case it needs to calculate based on HTTP headers some additional headers that upstream uses. To do that I simply use header mutation. It works perfectly.

For two cases (specific endpoint path) I also need to consume body to be able to calculate header mutation. The idea was that I change request body mode on the fly (by default it is NONE) to STREAMED mode so I can consume it for this special case and calculate headers. It looks like envoy is expecting request header (mutation) response on first request (kRequestHeaders case). 

It looks to me that from source code that until I send headers back it will not continue to send body. Do you know how to achieve what I try to do? What is correct procedure? That means:

1. Consume headers
2. Consume body
3. Send headers back to envoy

Here is where I am getting failure:

Thanks,
Tomas

Tomas Kolda

unread,
Jan 28, 2025, 8:19:40 AM1/28/25
to envoy-users
I found a solution. Sometimes it helps to ask :) . Issue was that use case I described works only for body mode BUFFERED_PARTIAL or BUFFERED.

Now everything works as expected.

Thank you!
Tomas
Reply all
Reply to author
Forward
0 new messages