envoyproxy/envoy

Accessing request headers in envoy_on_response (lua HTTP filter).

Open

#4,613 创建于 2018年10月5日

在 GitHub 查看
 (16 评论) (17 反应) (0 负责人)C++ (5,373 fork)batch import
area/luahelp wanted

仓库指标

Star
 (27,997 star)
PR 合并指标
 (平均合并 8天) (30 天内合并 378 个 PR)

描述

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?

贡献者指南