mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 16:54:04 +00:00
Update server/routers/api-router.js
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
parent
53c4bba387
commit
7270caccae
1 changed files with 2 additions and 2 deletions
|
@ -313,8 +313,8 @@ router.get("/api/badge/:id/ping/:duration?", cache("5 minutes"), async (request,
|
||||||
let requestedDuration = request.params.duration !== undefined ? request.params.duration : "24";
|
let requestedDuration = request.params.duration !== undefined ? request.params.duration : "24";
|
||||||
const overrideValue = value && parseFloat(value);
|
const overrideValue = value && parseFloat(value);
|
||||||
|
|
||||||
if (isNumeric(requestedDuration)) { // all numeric only
|
if (/^[0-9]+$/.test(requestedDuration)) {
|
||||||
requestedDuration = `${requestedDuration}${durationUnits.HOUR}`;
|
requestedDuration = `${requestedDuration}h`;
|
||||||
}
|
}
|
||||||
const duration = requestedDuration.slice(0, -1);
|
const duration = requestedDuration.slice(0, -1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue