From 3f425dc1606cb6b8d8eaea62ca2b38f2d6e71014 Mon Sep 17 00:00:00 2001 From: Qi Zhao <956361916@qq.com> Date: Thu, 13 Jun 2024 23:28:51 +0800 Subject: [PATCH] Update server/routers/api-router.js Co-authored-by: Frank Elsinga --- server/routers/api-router.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routers/api-router.js b/server/routers/api-router.js index 45e726732..bb8b75695 100644 --- a/server/routers/api-router.js +++ b/server/routers/api-router.js @@ -335,7 +335,7 @@ router.get("/api/badge/:id/ping/:duration?", cache("5 minutes"), async (request, // use a given, custom labelColor or use the default badge label color (defined by badge-maker) badgeValues.labelColor = labelColor ?? ""; // build a lable string. If a custom label is given, override the default one (requestedDuration) - badgeValues.label = filterAndJoin([ labelPrefix, label ?? `Avg. Ping (${duration}${labelSuffix})` ]); + badgeValues.label = filterAndJoin([ labelPrefix, label ?? `Avg. Ping (${requestedDuration.slice(0, -1)}${labelSuffix})` ]); badgeValues.message = filterAndJoin([ prefix, avgPing, suffix ]); }