envoyproxy/envoy

Accessing request headers in envoy_on_response (lua HTTP filter).

Open

#4.613 geöffnet am 5. Okt. 2018

Auf GitHub ansehen
 (16 Kommentare) (17 Reaktionen) (0 zugewiesene Personen)C++ (5.373 Forks)batch import
area/luahelp wanted

Repository-Metriken

Stars
 (27.997 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T) (378 gemergte PRs in 30 T)

Beschreibung

I'm trying to use a lua HTTP filter to set a response header whose value depends on a request header.

As a simple example, suppose we want to copy a header from the request to the response. How can we do this using a lua filter?

Maybe we can store the request header in a "global" table during envoy_on_request and read it later when envoy_on_response is called. However, even if this approach makes sense, how can we correlate responses with requests to be able to do this?

Contributor Guide