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:
parent
081e0a9d20
commit
4f7f20616e
2 changed files with 6 additions and 1 deletions
5
.changeset/chilly-pumpkins-fetch.md
Normal file
5
.changeset/chilly-pumpkins-fetch.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix redirect() typing to allow all redirection status codes.
|
|
@ -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>>
|
||||
|
|
Loading…
Reference in a new issue