feat(ext-plugin-post-resp): support get response body by extra_info#7947
feat(ext-plugin-post-resp): support get response body by extra_info#7947spacewander merged 11 commits intoapache:masterfrom
Conversation
t/plugin/ext-plugin/extra-info.t
Outdated
|
|
||
|
|
||
|
|
||
| === TEST 10: ask request body (not exist) |
There was a problem hiding this comment.
why we check request body here?
There was a problem hiding this comment.
I reused the handle_extra_info function to get the response body, the request body is part of this function.
|
LGTM |
|
|
||
|
|
||
|
|
||
| === TEST 5: ask response body (not exist) |
There was a problem hiding this comment.
Let's add a test with empty response body
There was a problem hiding this comment.
It doesn't make sense to add a test with an empty response body in the ext-plugin-pre-req plugin. I guess you want me to add this test case in the ext-plugin-post-resp plugin.
However, an empty response body usually occurs when the upstream returns a 304 status code or the request method is HEAD, which needs to be handled separately in subsequent PRs. I have added TODO.
apisix/plugins/ext-plugin/helper.lua
Outdated
|
|
||
| repeat | ||
| local chunk, read_err, cb_err | ||
| -- TODO: HEAD or 304 |
There was a problem hiding this comment.
Could you use at least one sentence for this TODO? I can't recall why this comment is added.
…pache#7947) Co-authored-by: soulbird <zhaothree@gmail.com>
Description
Provide the
ext-plugin-post-respplugin with the ability to get the response body, so that the External Plugin will be able to do some processing on the response body.As an additional feature, the
ext-plugin-post-respplugin also supports getting the request context in the response phase.Fixes #7575
Checklist