Skip to content

Commit

Permalink
test: fix HTTP req headers
Browse files Browse the repository at this point in the history
  • Loading branch information
wallet77 committed Nov 21, 2023
1 parent f6aa03a commit 0b0b742
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ let METRICS_ROUTE = '/metrics'
const requestListener = async (req, res) => {
if (req.url === METRICS_ROUTE) {
try {
const data = await client.register.metrics()
res.writeHead(200, { 'Content-Type': client.register.contentType })
return res.end(await client.register.metrics())
return res.end(data)
} catch (ex) {
error(ex)
res.writeHead(500, { 'Content-Type': 'text/html' })
Expand Down

0 comments on commit 0b0b742

Please sign in to comment.