Function redirector

Source
pub async fn redirector<B: Debug + Send + 'static>(
    req: Request<B>,
    store: Store,
    config: Redirector,
    stat_info: ExtraStatisticInfo,
) -> Result<Response<String>, Error>
Expand description

Redirects the request to the appropriate target URL (if one is found in the store) or returns a 404 Not Found response. When redirecting, the status code is 302 Found when the method is GET, and 307 Temporary Redirect otherwise. Additionally, stat_info can be used to pass extra Statistics to be collected in addition to the ones inside of this function.