Current Behavior
- Enable http2 on the APISIX gateway listener.
- Configure a route or Ingress that uses the ext-plugin-post-resp plugin.
- Make sure the request reaches the ext-plugin-post-resp code path.
For example, attach an ApisixPluginConfig with ext-plugin-post-resp enabled to an Ingress.
- Send an HTTP/2 GET request that has no request body and no Content-Length header.
Example:
curl -k -i --http2 'https://(host)/xx/'
- Observe that APISIX returns 502.
Relevant code path
- apisix/plugins/ext-plugin-post-resp.lua
- apisix/core/request.lua
The failure is triggered by logic equivalent to:
if (var.server_protocol == "HTTP/2.0" or var.server_protocol == "HTTP/3.0")
and not content_length then
return nil, "HTTP2/HTTP3 request without a Content-Length header"
end
Expected Behavior
The request should not fail.
For an HTTP/2 or HTTP/3 GET request without a body, APISIX should treat the request body as empty and continue normally. Content-Length should not be required in this case.
Error Logs
[lua] ext-plugin-post-resp.lua:153: phase_func(): failed to request: HTTP2/HTTP3 request without a Content-Length header
[lua] plugin.lua:1198: common_phase(): ext-plugin-post-resp exits with http status code 502
Steps to Reproduce
Refer to the Current Behavior section
Environment
- APISIX version (run
apisix version): 3.15.0
- Operating system (run
uname -a):
- OpenResty / Nginx version (run
openresty -V or nginx -V):
- etcd version, if relevant (run
curl http://127.0.0.1:9090/v1/server_info):
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run
luarocks --version):
Current Behavior
For example, attach an ApisixPluginConfig with ext-plugin-post-resp enabled to an Ingress.
Example:
curl -k -i --http2 'https://(host)/xx/'
Relevant code path
The failure is triggered by logic equivalent to:
if (var.server_protocol == "HTTP/2.0" or var.server_protocol == "HTTP/3.0")
and not content_length then
return nil, "HTTP2/HTTP3 request without a Content-Length header"
end
Expected Behavior
The request should not fail.
For an HTTP/2 or HTTP/3 GET request without a body, APISIX should treat the request body as empty and continue normally. Content-Length should not be required in this case.
Error Logs
[lua] ext-plugin-post-resp.lua:153: phase_func(): failed to request: HTTP2/HTTP3 request without a Content-Length header
[lua] plugin.lua:1198: common_phase(): ext-plugin-post-resp exits with http status code 502
Steps to Reproduce
Refer to the Current Behavior section
Environment
apisix version): 3.15.0uname -a):openresty -Vornginx -V):curl http://127.0.0.1:9090/v1/server_info):luarocks --version):