From 5a8e36a81529f047b92b8af59b7775a29fc9663f Mon Sep 17 00:00:00 2001 From: Ayush7614 Date: Sat, 5 Sep 2026 15:36:16 +0530 Subject: [PATCH] fix(server): accept uppercase duration units in durationMs --- server/src/config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/config.ts b/server/src/config.ts index 7c873985..a595700d 100644 --- a/server/src/config.ts +++ b/server/src/config.ts @@ -715,14 +715,14 @@ function privateHostsAllowed(environment: Environment): boolean { * its meaning. */ export function durationMs(value: string): number { - const match = /^(\d+)\s*(ms|s|m|h)?$/.exec(value.trim()); + const match = /^(\d+)\s*(ms|s|m|h)?$/i.exec(value.trim()); if (!match) { throw new Error( `"${value}" is not a duration. Write it as 30s, 30m, 2h, or a plain number of milliseconds.`, ); } const amount = Number(match[1]); - switch (match[2]) { + switch (match[2]?.toLowerCase()) { case "h": return amount * 3_600_000; case "m":