fix: 修复utf8的校验和json返回类型

This commit is contained in:
hugy committed 2023-04-25 08:48:16 +08:00
1 parent 6105789fcc
commit f9a7924658
4 files changed
+39 -15

No files matched your search

+1 -1
View File
@@ -588,7 +588,7 @@ void HttpHandler::HandlerRequest(struct mg_connection *c, void *ev_data) {
ret = res.dump();
}
if (ret != "") {
mg_http_reply(c, 200, "", ret.c_str(), 0, 0);
mg_http_reply(c, 200, "Content-Type: application/json\r\n", "%s\n", ret.c_str());
}
} else {
mg_http_reply(c, 500, NULL, "%s", "Invalid URI");