apache / apisix

The Cloud-Native API Gateway
https://apisix.apache.org/blog/
Apache License 2.0
14.55k stars 2.52k forks source link

refactor: use setmetatable to set hidden variables without effecting serialisation #11770

Closed Revolyssup closed 4 days ago

Revolyssup commented 4 days ago

Description

Users hope to directly use the decoded body in the template of body-transformer, modify its fields, and then encode it again. Previously, we set several hidden variables in the _out variable, including function-type variables, which caused issues with direct encoding.

Fixes # (issue)

Checklist