gujiwork commented on issue #10163: URL: https://github.com/apache/apisix/issues/10163#issuecomment-1751667434
> @gujiwork Hi, I used [lua-resty-string](https://github.com/openresty/lua-resty-string) and it worked fluently, and it has examples. Thank you for your reply, but I can't get response data using core.response.hold_body_chunk(ctx). ``` return function(conf, ctx) local core = require(\"apisix.core\"); local aes = require 'resty.aes'; local cjson = require(\"cjson\"); local ngx_resp = require \"ngx.resp\"; local cipher = aes:new('0123456789123456', nil, aes.cipher(128, 'ecb')); local body = core.response.hold_body_chunk(ctx) core.response.set_header(\"X-API-VERSION\", \"v1\"); ngx.say(ngx.encode_base64(cipher:encrypt(body))) end ``` -- 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]
