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 to loc.
set_redirect_hook
Sets a function that will be called if a server function returns a 3xx status or the REDIRECT_HEADER. Returns Err(_) if the hook has already been set.

Type Aliases§

RedirectHook
A function that will be called if a server function returns a 3xx status or the REDIRECT_HEADER.