singhjoga opened a new issue, #9045:
URL: https://github.com/apache/apisix/issues/9045
### Description
Hi,
I am trying to transform the request and response using 'body-transformer'
plugin, but it seems to be not executing. I using APISIX 3.2.0 in standalone
mode. Below is the route configuration:
`routes:
- uri: /auth/realms/KPMS/protocol/openid-connect/token
plugins:
body-transformer:
request:
template: "{% ngx.req.read_body(); local args, err =
ngx.req.get_post_args(); for key, val in pairs(args) do ngx.req.set_header(key,
val); end; %}"
proxy-rewrite:
uri: /gen_token?key=$http_client_id
method: "GET"
upstream:
type: "roundrobin"
scheme: "http"
nodes:
"127.0.0.1:9080": 1
- uri: /gen_token
plugins:
public-api:
uri: "/apisix/plugin/jwt/sign"`
Here Client-Id header is being set in the request.template from the request
body. I tested with 'serverless-pre-function', it works. But I also need to
generate custom response, therefore want to use 'body-transformer'.
Any ideas what I am missing here.
### Environment
- APISIX version (run `apisix version`): 3.2.0
- Operating system (run `uname -a`): Linux DESKTOP-5O11R9R
5.10.16.3-microsoft-standard-WSL2
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
- etcd version, if relevant (run `curl
http://127.0.0.1:9090/v1/server_info`): Standalone mode
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]