#Experimental rewriting on HTTP POST?
8 messages · Page 1 of 1 (latest)
I kinda solved it now with a 407 redirect instead, that also keeps any POST + FormData. Was just a bit nervous about browser support for 407, which is why I was trying out Astro.rewrite
Issue tracked here: https://github.com/withastro/astro/issues/11127
Astro.rewrite is still browser behaviour, all it really does is sends the appropriate HTTP header to the client and they are the ones who do the redirect
if the browser has no support for forwarding FormData, or intentionally disables it for security reasons, then you cannot rely on this behaviour.
In general, you usually can just modify your form to send to the correct URL or resolve the target URL first.
@brazen vale Are you sure this is the case? I would expect that the browser would update the URL when that happens. I don't see that it's an implicit redirect, but it rather looks like it is fully handled on the server: https://github.com/withastro/roadmap/blob/feat/reroute/proposals/0047-rerouting.md
Anyway, they fixed it upstream in Astro 4.10 🎊