openresty / lua-nginx-module

Embed the Power of Lua into NGINX HTTP servers
https://openresty.org/
11.33k stars 2.03k forks source link

bugfix: let `balancer.recreate_request` API work for body data changed case #2334

Closed oowl closed 4 months ago

oowl commented 4 months ago

I hereby granted the copyright of the changes in this pull request to the authors of this lua-nginx-module project.

Context: https://github.com/openresty/lua-nginx-module/issues/2333

oowl commented 4 months ago

From https://github.com/openresty/lua-resty-core/blob/master/lib/ngx/balancer.md#recreate_request, recreate_request will recreate all request buffers which send upstream, So it's not only the header but also body data, that's an implementation bug for openresty.

zhuizhuhaomeng commented 4 months ago

@oowl please add a test case to cover this bug.

oowl commented 4 months ago

@zhuizhuhaomeng CI is flaky, I am not sure why the plan number is not stable in our Perl test.