我可以将 headers 添加到 envoy lua 过滤器中的 httpCall 方法吗?
Can I add headers to httpCall method in envoy lua filter?
我尝试在httpCall
方法中添加更多headers,但上游无法接收。
lua 脚本示例:
lua
request_handle:httpCall(
"service1",
{
[":method"] = "POST",
[":path"] = "/",
[":authority"] = "lua_cluster",
[":authorization"] = "Basic 123456"
},
"",
1000)
有没有3个headers?
您可以定义任何 header 如下。
request_handle:httpCall(
"service1",
{
[":method"] = "POST",
[":path"] = "/",
[":authority"] = "lua_cluster",
["authorization"] = "Basic 123456",
["any-header"] = "header-value"
},
"",
1000)
我尝试在httpCall
方法中添加更多headers,但上游无法接收。
lua 脚本示例:
lua
request_handle:httpCall(
"service1",
{
[":method"] = "POST",
[":path"] = "/",
[":authority"] = "lua_cluster",
[":authorization"] = "Basic 123456"
},
"",
1000)
有没有3个headers?
您可以定义任何 header 如下。
request_handle:httpCall(
"service1",
{
[":method"] = "POST",
[":path"] = "/",
[":authority"] = "lua_cluster",
["authorization"] = "Basic 123456",
["any-header"] = "header-value"
},
"",
1000)