Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,14 +735,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":
Expand Down