0
0
Fork 0

Fix missing or incorrect cache-control headers for Streaming server (#32551)

This commit is contained in:
Emelia Smith 2024-10-17 10:17:18 +02:00 committed by GitHub
parent 5103abc3ec
commit b23ff050ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -98,9 +98,11 @@ export function setupMetrics(channels, pgPool) {
const requestHandler = (req, res) => {
metrics.register.metrics().then((output) => {
res.set('Content-Type', metrics.register.contentType);
res.set('Cache-Control', 'private, no-store');
res.end(output);
}).catch((err) => {
req.log.error(err, "Error collecting metrics");
res.set('Cache-Control', 'private, no-store');
res.status(500).end();
});
};