mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-06 10:57:50 +08:00
修复http头传入python fast api失败的问题
This commit is contained in:
parent
752f705b36
commit
1bc40690c9
@ -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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user