Allow all redirection status codes in redirect() (#5446)

See https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages for the list.
This commit is contained in:
Jeffrey Yasskin 2022-12-07 07:52:12 -08:00 committed by GitHub
parent 081e0a9d20
commit 4f7f20616e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix redirect() typing to allow all redirection status codes.

View file

@ -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>>