1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-18 08:40:29 +01:00

Set UTF-8 encoding and version for prometheus /metrics ()

This commit is contained in:
Igor Scheller 2022-01-04 10:14:38 +01:00 committed by GitHub
parent 5143a5b5c5
commit 26dd1f8532
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,7 +7,7 @@ namespace esphome {
namespace prometheus { namespace prometheus {
void PrometheusHandler::handleRequest(AsyncWebServerRequest *req) { void PrometheusHandler::handleRequest(AsyncWebServerRequest *req) {
AsyncResponseStream *stream = req->beginResponseStream("text/plain"); AsyncResponseStream *stream = req->beginResponseStream("text/plain; version=0.0.4; charset=utf-8");
#ifdef USE_SENSOR #ifdef USE_SENSOR
this->sensor_type_(stream); this->sensor_type_(stream);