Skip to content

fix(ext-plugin-post-resp): avoid H2/H3 Content-Length check when read…#13243

Open
Goend wants to merge 1 commit intoapache:masterfrom
Goend:master
Open

fix(ext-plugin-post-resp): avoid H2/H3 Content-Length check when read…#13243
Goend wants to merge 1 commit intoapache:masterfrom
Goend:master

Conversation

@Goend
Copy link
Copy Markdown

@Goend Goend commented Apr 17, 2026

Description

This PR fixes an issue in ext-plugin-post-resp when handling HTTP/2 and HTTP/3 requests without a Content-Length header.

Currently, ext-plugin-post-resp replays the original client request to upstream and reads the request body via core.request.get_body(). After the behavior introduced in #10887, core.request.get_body() rejects
HTTP/2 and HTTP/3 requests that do not contain a Content-Length header.

This causes valid body-less requests such as normal GET requests over HTTP/2 to fail unexpectedly with 502 when ext-plugin-post-resp is enabled.

This PR avoids using core.request.get_body() in ext-plugin-post-resp and reads the request body directly from the Nginx request APIs instead. As a result, body-less HTTP/2 and HTTP/3 requests are handled
correctly, while requests that actually contain a body can still be forwarded as expected.

Which issue(s) this PR fixes:

Fixes #13237

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: 502 error when using ext-plugin-post-resp due to HTTP/2/HTTP/3 request without Content-Length header

1 participant