Skip to content

Commit

Permalink
Allow all redirection status codes in redirect()
Browse files Browse the repository at this point in the history
  • Loading branch information
jyasskin committed Nov 21, 2022
1 parent 4b18813 commit 33775a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/chilly-pumpkins-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix redirect() typing to allow all redirection status codes.
2 changes: 1 addition & 1 deletion packages/astro/src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,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>>
Expand Down

0 comments on commit 33775a2

Please sign in to comment.