Modify the fetch request to follow redirects from the origin, ensuring the client receives the final response.
This template is ready for use and should fit most redirect-following scenarios.
It ensures the Snippet transparently follows redirects issued by the origin server. The redirect: "follow" option of the Fetch API ensures automatic handling of 3xx redirects, returning the final response. If the origin response is not a redirect, the original content is returned.
Was this helpful?
What did you like?
What went wrong?
Thank you for helping improve Cloudflare's documentation!