Skip to content

Commit 77fc25d

Browse files
committed
Call res.write('') inside apiRes.redirect() helper
1 parent 9b3edd3 commit 77fc25d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/next/next-server/server/api-utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ export function redirect(
212212
`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').`
213213
)
214214
}
215-
res.writeHead(statusOrUrl, { Location: url }).end()
215+
res.writeHead(statusOrUrl, { Location: url })
216+
res.write('')
217+
res.end()
216218
return res
217219
}
218220

0 commit comments

Comments
 (0)