fix(ext-plugin-post-resp): avoid H2/H3 Content-Length check when read…#13243
Open
Goend wants to merge 1 commit intoapache:masterfrom
Open
fix(ext-plugin-post-resp): avoid H2/H3 Content-Length check when read…#13243Goend wants to merge 1 commit intoapache:masterfrom
Goend wants to merge 1 commit intoapache:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an issue in
ext-plugin-post-respwhen handling HTTP/2 and HTTP/3 requests without aContent-Lengthheader.Currently,
ext-plugin-post-respreplays the original client request to upstream and reads the request body viacore.request.get_body(). After the behavior introduced in #10887,core.request.get_body()rejectsHTTP/2 and HTTP/3 requests that do not contain a
Content-Lengthheader.This causes valid body-less requests such as normal
GETrequests over HTTP/2 to fail unexpectedly with502whenext-plugin-post-respis enabled.This PR avoids using
core.request.get_body()inext-plugin-post-respand reads the request body directly from the Nginx request APIs instead. As a result, body-less HTTP/2 and HTTP/3 requests are handledcorrectly, while requests that actually contain a body can still be forwarded as expected.
Which issue(s) this PR fixes:
Fixes #13237
Checklist