Skip to content

Commit

Permalink
update NextResponse default redirect status to 307 to match docs (#33505
Browse files Browse the repository at this point in the history
)

* fix: update default redirect status to 307 to match docs

* fix: update default redirect status to 307 to match docs

Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
sean6bucks and ijjk committed Feb 1, 2022
1 parent 51f0359 commit 5d9310e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/next/server/web/spec-compliant/response.ts
Expand Up @@ -39,7 +39,7 @@ class BaseResponse extends Body implements Response {
}
}

static redirect(url: string, status = 302) {
static redirect(url: string, status = 307) {
if (!REDIRECTS.has(status)) {
throw new RangeError(
'Failed to execute "redirect" on "response": Invalid status code'
Expand Down
2 changes: 1 addition & 1 deletion packages/next/server/web/spec-extension/response.ts
Expand Up @@ -73,7 +73,7 @@ export class NextResponse extends Response {
})
}

static redirect(url: string | NextURL | URL, status = 302) {
static redirect(url: string | NextURL | URL, status = 307) {
if (!REDIRECTS.has(status)) {
throw new RangeError(
'Failed to execute "redirect" on "response": Invalid status code'
Expand Down

0 comments on commit 5d9310e

Please sign in to comment.