diff options
author | 2023-07-19 15:52:50 +0800 | |
---|---|---|
committer | 2023-07-19 15:52:50 +0800 | |
commit | 019b797bf83201d2d4834cc9e0dde30f6a48daa2 (patch) | |
tree | eee50df295ecfa67ed08fc78d95b00e571ccbdaf | |
parent | de65ad25eae010b42ef55c127cc98d4cc3aa66db (diff) | |
download | astro-019b797bf83201d2d4834cc9e0dde30f6a48daa2.tar.gz astro-019b797bf83201d2d4834cc9e0dde30f6a48daa2.tar.zst astro-019b797bf83201d2d4834cc9e0dde30f6a48daa2.zip |
Fix redirects map object-form value validation (#7701)
-rw-r--r-- | .changeset/eleven-eyes-jog.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/config/schema.ts | 21 |
2 files changed, 25 insertions, 1 deletions
diff --git a/.changeset/eleven-eyes-jog.md b/.changeset/eleven-eyes-jog.md new file mode 100644 index 000000000..ebd4b4fe1 --- /dev/null +++ b/.changeset/eleven-eyes-jog.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix redirects map object-form value validation diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts index 16bfbbac7..70c9e03a7 100644 --- a/packages/astro/src/core/config/schema.ts +++ b/packages/astro/src/core/config/schema.ts @@ -149,7 +149,26 @@ export const AstroConfigSchema = z.object({ .optional() .default({}) ), - redirects: z.record(z.string(), z.string()).default(ASTRO_CONFIG_DEFAULTS.redirects), + redirects: z + .record( + z.string(), + z.union([ + z.string(), + z.object({ + status: z.union([ + z.literal(300), + z.literal(301), + z.literal(302), + z.literal(303), + z.literal(304), + z.literal(307), + z.literal(308), + ]), + destination: z.string(), + }), + ]) + ) + .default(ASTRO_CONFIG_DEFAULTS.redirects), image: z .object({ service: z.object({ |