Module redirect
Expand description
Utilities to allow client-side redirects.
Constants§
- REDIRECT_
HEADER - A custom header that can be set with any value to indicate that the server function client should redirect to a new route.
Functions§
- call_
redirect_ hook - Calls the hook that has been set by
set_redirect_hook
to redirect toloc
. - set_
redirect_ hook - Sets a function that will be called if a server function returns a
3xx
status or theREDIRECT_HEADER
. ReturnsErr(_)
if the hook has already been set.
Type Aliases§
- Redirect
Hook - A function that will be called if a server function returns a
3xx
status or theREDIRECT_HEADER
.