diff options
author | 2022-12-07 07:52:12 -0800 | |
---|---|---|
committer | 2022-12-07 23:52:12 +0800 | |
commit | 4f7f20616ed2b63f94ebf43bc5fdc1be55062a94 (patch) | |
tree | f790724b327059f3414cf15b76b306478c2c68e0 | |
parent | 081e0a9d2070b23d596b687ad52ed3a68bc3ac24 (diff) | |
download | astro-4f7f20616ed2b63f94ebf43bc5fdc1be55062a94.tar.gz astro-4f7f20616ed2b63f94ebf43bc5fdc1be55062a94.tar.zst astro-4f7f20616ed2b63f94ebf43bc5fdc1be55062a94.zip |
Allow all redirection status codes in redirect() (#5446)
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages for the list.
-rw-r--r-- | .changeset/chilly-pumpkins-fetch.md | 5 | ||||
-rw-r--r-- | packages/astro/src/@types/astro.ts | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/chilly-pumpkins-fetch.md b/.changeset/chilly-pumpkins-fetch.md new file mode 100644 index 000000000..f0e5ef55c --- /dev/null +++ b/.changeset/chilly-pumpkins-fetch.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix redirect() typing to allow all redirection status codes. diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 4bbbe996f..c27d88b47 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -1190,7 +1190,7 @@ interface AstroSharedContext<Props extends Record<string, any> = Record<string, /** * Redirect to another page (**SSR Only**). */ - redirect(path: string, status?: 301 | 302 | 308): Response; + redirect(path: string, status?: 301 | 302 | 303 | 307 | 308): Response; } export interface APIContext<Props extends Record<string, any> = Record<string, any>> |