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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

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;
};