Skip to content

Commit

Permalink
Call res.write('') inside apiRes.redirect() helper
Browse files Browse the repository at this point in the history
  • Loading branch information
kachkaev committed Dec 24, 2020
1 parent 9b3edd3 commit 77fc25d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/next/next-server/server/api-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ export function redirect(
`Invalid redirect arguments. Please use a single argument URL, e.g. res.redirect('/destination') or use a status code and URL, e.g. res.redirect(307, '/destination').`
)
}
res.writeHead(statusOrUrl, { Location: url }).end()
res.writeHead(statusOrUrl, { Location: url })
res.write('')
res.end()
return res
}

Expand Down

0 comments on commit 77fc25d

Please sign in to comment.