You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 302 redirect is the default in framework, but it's kinda awkward and replaced by 303 and 307 since HTTP1.1.
Backstory
301 and 302 were originally intended to not change the request method, but most of the browsers made a method swap to GET. So the spec was changed to say that the method "may" be changed. https://datatracker.ietf.org/doc/html/rfc7231#section-6.4.3
There are other status codes to be more explicit:
303 See Other means "redirect and change method to GET".
307 Temporary Redirect means "redirect and keep the method".
The 303 is intended for all the cases where a POST/PUT/DELETE is accepted and the user is redirected to the list or page to view resource, or just back to the editing page in case of an error.
Proposal
I looked through the code base and it looks like all the 302 redirects in the codebase are actually intended to be 303. Could we change the defaults to use the unambiguous 303?
I am not aware of any current browsers that don't support 303. After all RFC 2616 was introduced in 1999.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
The 302 redirect is the default in framework, but it's kinda awkward and replaced by 303 and 307 since HTTP1.1.
Backstory
301 and 302 were originally intended to not change the request method, but most of the browsers made a method swap to GET. So the spec was changed to say that the method "may" be changed. https://datatracker.ietf.org/doc/html/rfc7231#section-6.4.3
There are other status codes to be more explicit:
303 See Other
means "redirect and change method to GET".307 Temporary Redirect
means "redirect and keep the method".The 303 is intended for all the cases where a POST/PUT/DELETE is accepted and the user is redirected to the list or page to view resource, or just back to the editing page in case of an error.
Proposal
I looked through the code base and it looks like all the 302 redirects in the codebase are actually intended to be 303. Could we change the defaults to use the unambiguous 303?
I am not aware of any current browsers that don't support 303. After all RFC 2616 was introduced in 1999.
Beta Was this translation helpful? Give feedback.
All reactions