Replies: 1 comment 2 replies
-
I am not sure what use case such a thing could be helpful for. If you return a redirect, every browser and most HTTP clients will automatically follow this redirect. You will likely never see the return body everywhere. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The documentation does mention in https://kit.svelte.dev/docs/routing#page-actions that it is possible to add a redirect to the return of a POST action:
However, what if you would like to return a body and a redirect at the same time? When I have to return a body I use
new Response(String(body))
but adding thelocation
as innew Response(String(body), {headers: {location: url}})
doesn't give a functioning redirect. How can I do both at the same time?Beta Was this translation helpful? Give feedback.
All reactions