Goend opened a new issue, #13237:
URL: https://github.com/apache/apisix/issues/13237
### Current Behavior
1. Enable http2 on the APISIX gateway listener.
2. Configure a route or Ingress that uses the ext-plugin-post-resp plugin.
3. 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.
4. Send an HTTP/2 GET request that has no request body and no
Content-Length header.
Example:
curl -k -i --http2 'https://(host)/xx/'
5. 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`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]