This is an automated email from the ASF dual-hosted git repository.
nic-6443 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new 8048e7447 fix: remove stale HTTP2 body guard (#13428)
8048e7447 is described below
commit 8048e744750675340ed1455e3d81c3610bd89c1b
Author: Nic <[email protected]>
AuthorDate: Tue May 26 09:21:42 2026 +0800
fix: remove stale HTTP2 body guard (#13428)
---
apisix/core/request.lua | 9 ---------
t/plugin/azure-functions.t | 14 --------------
2 files changed, 23 deletions(-)
diff --git a/apisix/core/request.lua b/apisix/core/request.lua
index f999a2cda..c07422873 100644
--- a/apisix/core/request.lua
+++ b/apisix/core/request.lua
@@ -296,15 +296,6 @@ function _M.get_body(max_size, ctx)
end
end
- -- check content-length header for http2/http3
- do
- local var = ctx and ctx.var or ngx.var
- local content_length = tonumber(var.http_content_length)
- 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
- end
req_read_body()
local req_body = req_get_body_data()
diff --git a/t/plugin/azure-functions.t b/t/plugin/azure-functions.t
index 72f9bbc6b..b0395c6ba 100644
--- a/t/plugin/azure-functions.t
+++ b/t/plugin/azure-functions.t
@@ -189,8 +189,6 @@ X-Extra-Header: MUST
--- http2
--- request
GET /azure
---- more_headers
-Content-Length: 0
--- response_body
faas invoked
@@ -210,8 +208,6 @@ server: APISIX/2.10.2
--- http2
--- request
HEAD /azure
---- more_headers
-Content-Length: 0
--- response_headers
Connection:
Upgrade:
@@ -498,13 +494,3 @@ invocation /api successful
}
--- response_body
passed
-
-
-
-=== TEST 15: http2 failed to check response body and headers
---- http2
---- request
-GET /azure
---- error_code: 400
---- error_log
-HTTP2/HTTP3 request without a Content-Length header,