Skip to content

Commit 6b18332

Browse files
committed
Fix for optional headers
1 parent f9a2c48 commit 6b18332

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const defaultContext = {
3636
const screenshotSchema = z.object({
3737
url: z.string().url(),
3838
theme: z.enum(["light", "dark"]).default("light"),
39-
headers: z.record(z.string(), z.any()),
39+
headers: z.record(z.string(), z.any()).optional(),
4040
sleep: z.number().min(0).max(60000).default(3000),
4141
});
4242
router.post(
@@ -59,7 +59,7 @@ router.post(
5959
return await route.continue({
6060
headers: {
6161
...request.headers(),
62-
...body.headers,
62+
...(body.headers || {}),
6363
},
6464
});
6565
}

0 commit comments

Comments
 (0)