chore(server): set Content-Type header (#1651)

This commit is contained in:
Sander Bruens 2025-03-10 14:25:18 -04:00 committed by GitHub
parent d9aa8560ce
commit 9013feafa7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -48,6 +48,7 @@ const MMDB_LOCATION_ASN = '/var/lib/libmaxminddb/ip-asn.mmdb';
async function exportPrometheusMetrics(registry: prometheus.Registry, port): Promise<http.Server> {
return new Promise<http.Server>((resolve, _) => {
const server = http.createServer((_, res) => {
res.setHeader('Content-Type', registry.contentType);
res.write(registry.metrics());
res.end();
});