Skip to content

Commit 0c0245d

Browse files
committed
Normalize wait value to nonzero integer
1 parent fc0b718 commit 0c0245d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/predictions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ async function createPrediction(options) {
2727
const headers = {};
2828
if (wait) {
2929
if (typeof wait === "number") {
30-
headers["Prefer"] = `wait=${wait}`;
30+
const n = Math.max(1, Math.ceil(Number(wait)) || 1);
31+
headers["Prefer"] = `wait=${n}`;
3132
} else {
3233
headers["Prefer"] = "wait";
3334
}

0 commit comments

Comments
 (0)