Hotwire Discussion

Redirecting After a Form Submission: 303 only?

I’m playing a bit with a newly generated rails 7 app. I scaffolded a resource and was trying form submission, all is working as expected.

I was reading documentation and was surprised by this:

After a stateful request from a form submission, Turbo Drive expects the server to return an HTTP 303 redirect response

When I look at server logs, it returns 302 redirects and it seems to work fine. Is this an issue with documentation ? Or is redirecting with 303 really a hard requirement?

Also, looking at the logs, I was surprised to see TURBO_STREAM as the content type, as no streaming is involved really, but I guess this is the content type used by all turbo js requests? Or am I missing something?