server: fix: /metrics endpoint returning JSON-escaped Prometheus format (#17386)

* fix: /metrics endpoint returning JSON-escaped Prometheus format

* mod: remove string overload from ok() method
This commit is contained in:
o7si
2025-11-29 02:14:00 +08:00
committed by GitHub
parent e072b2052e
commit 3ce7a65c2f
+2 -1
View File
@@ -2713,7 +2713,8 @@ public:
res->headers["Process-Start-Time-Unix"] = std::to_string(res_task->t_start);
res->content_type = "text/plain; version=0.0.4";
res->ok(prometheus.str());
res->status = 200;
res->data = prometheus.str();
return res;
};