Lua Script replace header value

26 views
Skip to first unread message

Rama Rao

unread,
Jan 18, 2018, 7:37:50 AM1/18/18
to envoy-users
When I am trying to update the existing header value with the following code

headers:add(key,value) - it does not update.

I had to call  headers::remove(key), before calling add to actually replace the value.

Based on the code of HeaderMap at https://github.com/envoyproxy/envoy/blob/master/source/common/http/header_map_impl.cc#L472, I am assuming that it is expected behavior.

Is that correct? or am I missing some thing here?

Thanks,
Rama

Matt Klein

unread,
Jan 18, 2018, 12:28:34 PM1/18/18
to Rama Rao, envoy-users
This is an artifact of how Envoy deals with the O(1)/inline headers. (I'm guessing you are trying to modify one of them).

I agree this is confusing, especially from the Lua perspective. Can you open a GH issue on this? I will try to look at a way to make this less confusing, either via Lua API change or doc change.

--
You received this message because you are subscribed to the Google Groups "envoy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to envoy-users+unsubscribe@googlegroups.com.
To post to this group, send email to envoy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/envoy-users/CAFfmCFEc-%2BPTmr2GHgpMh64mWRO-Due5KEYDRCdG1_m_SrsAdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--

Rama Rao

unread,
Jan 18, 2018, 11:16:01 PM1/18/18
to Matt Klein, envoy-users
Matt,
I am trying with ":authority" header. I have opened an issue https://github.com/envoyproxy/envoy/issues/2414.

Thanks,
Rama
Reply all
Reply to author
Forward
0 new messages