Skip to content

Commit

Permalink
return 405 when status service disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jchartrand committed Sep 5, 2024
1 parent 75c8272 commit bf6f348
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export async function build (opts = {}) {
})

app.get('/status/:statusCredentialId', async function (req, res, next) {
if (!enableStatusService) return res.status(405).send('The status service has not been enabled.')
const statusCredentialId = req.params.statusCredentialId
try {
const { data: statusCredential } = await axios.get(`http://${statusService}/${statusCredentialId}`)
Expand All @@ -144,7 +145,7 @@ export async function build (opts = {}) {
code: error.code
})
}
return res.status(200).send({ message: 'status service is not configured.' })
return res.status(500).send({ message: 'Server error.' })
})

// Attach the error handling middleware calls, in order they should run
Expand Down

0 comments on commit bf6f348

Please sign in to comment.