Skip to content

Commit

Permalink
metrics: retuen failure for date route if it's not 8 digits
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Jul 6, 2024
1 parent 0390c09 commit b8e93e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ansible/roles/metrics/files/summaries/summaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ app.post('/', async (req, res) => {
app.post('/date/:date', async (req, res) => {
const date = req.params.date

if (/^\d{8}$/.test(req.params.date)) {
if (!/^\d{8}$/.test(req.params.date)) {
res.status(400).send('Invalid date. Must be in YYYYMMDD format.')
return
}
Expand Down

0 comments on commit b8e93e7

Please sign in to comment.