diff options
| author | Jesper Jensen <jesper@jnsn.dev> | 2025-06-14 23:34:00 +0200 |
|---|---|---|
| committer | Jesper Jensen <jesper@jnsn.dev> | 2025-06-14 23:34:00 +0200 |
| commit | 6dcd11f89e0a1307f86f205c9a8f7204cac7c16b (patch) | |
| tree | b0e489fe7028608031bc2ffbee0625f8ff985957 /src | |
| parent | a806da7ddbb62b70322db412089af8749ec4e741 (diff) | |
Add content-type to metrics page
Diffstat (limited to 'src')
| -rw-r--r-- | src/metrics.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/metrics.c b/src/metrics.c index d3eaf52..fb81b77 100644 --- a/src/metrics.c +++ b/src/metrics.c @@ -54,6 +54,7 @@ enum MHD_Result promhttp_handler( if (strcmp(url, "/metrics") == 0) { const char *buf = prom_collector_registry_bridge(PROM_COLLECTOR_REGISTRY_DEFAULT); struct MHD_Response *response = MHD_create_response_from_buffer(strlen(buf), (void *)buf, MHD_RESPMEM_MUST_FREE); + if(MHD_add_response_header(response, "Content-Type", "text/plain; version=0.0.4") == MHD_NO) abort(); int ret = MHD_queue_response(connection, MHD_HTTP_OK, response); MHD_destroy_response(response); return ret; |
