envoyproxy / envoyproxy/envoy

Accessing request headers in envoy_on_response (lua HTTP filter).

Open
#4,613 16 comments 17 reactions 0 assignees View on GitHub
area/lua help wanted
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 20h
Merged PRs (30d)
428

Description

I'm trying to use a [lua HTTP filter](https://www.envoyproxy.io/docs/envoy/latest/configuration/http_filters/lua_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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.