admin管理员组文章数量:1334925
I need help in the configuration of the response transformer plugin for adding/appending dynamic headers to the response. I am able to add static headers to the response header, but even after adding the dynamic header, I get the static value.
However, the same configuration works with the request transformer plugin and the documentation of the response transformer plugin does not cover it.
The configuration of both the request and response transformer plugins is given below and I have enabled both of them on my ingress.
apiVersion: configuration.konghq/v1
config:
add:
headers:
- x-test-header:$(headers.Authorization)
kind: KongPlugin
metadata:
name: request-transformer
namespace: kong-test
plugin: request-transformer
and this one below too:
apiVersion: configuration.konghq/v1
config:
append:
headers:
- x-test-response-header:$(headers.x-test-header)
kind: KongPlugin
metadata:
name: response-transformer
namespace: kong-test
plugin: response-transformer
I have also tried response header with the value x-test-response-header:$(headers.Authorization)
and also add instead of append but i still get the same static value $(headers.Authorization)
in response header.
The headers are available in the body which i have tested using httpbin service.
{
"headers": {
"Accept": “/”,
"Accept-Encoding": “gzip, deflate, br”,
"Apikey": "123456",
"Authorization": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJlWkJzZTBYZURneTBwamxKaFczZVJtd29IdmxDN0lYaEFmMWFIRFVwWURnIn0…"
}
}
Please let me know the right way to configure it.
本文标签: Response transformer plugin configuration for Kong Kubernetes Ingress ControllerStack Overflow
版权声明:本文标题:Response transformer plugin configuration for Kong Kubernetes Ingress Controller - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742378945a2463726.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论