next.js
77f8889b - use 303 status code for redirects in fetch actions (#59017)

Commit
2 years ago
use 303 status code for redirects in fetch actions (#59017) ### What? A `redirect` that occurs during a fetch action will get a status code of 200, while the redirection logic is handled client-side. ### Why? In this scenario, the redirect is handled by the client router, so no `Location` is set on the action response. However for debugging / logging purposes, it'd be useful to still return the same status code used in other cases (see #58885) ### How? Rather than selectively setting the status to 303 in the non-fetch action case, this always applies it. Closes NEXT-1745
Author
Parents
Loading