From 1bc40690c92c2cc47aa982f51007d3f44f108987 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Wed, 18 Mar 2026 16:09:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhttp=E5=A4=B4=E4=BC=A0?= =?UTF-8?q?=E5=85=A5python=20fast=20api=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/pyinvoker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/pyinvoker.cpp b/server/pyinvoker.cpp index 9a642bb6..fb186164 100644 --- a/server/pyinvoker.cpp +++ b/server/pyinvoker.cpp @@ -138,7 +138,8 @@ void handle_http_request(const py::object &check_route, const py::object &submit scope["query_string"] = parser.params(); py::list hdrs; for (auto &kv : parser.getHeader()) { - hdrs.append(py::make_tuple(py::bytes(kv.first), py::bytes(kv.second))); + // Starlette/ASGI 规范要求 headers 的 key 必须全小写字节串 + hdrs.append(py::make_tuple(py::bytes(toolkit::strToLower(kv.first.data())), py::bytes(kv.second))); } scope["headers"] = hdrs;