fn make_redirect_url(req: &HttpRequest, redir_path: String) -> RedirectUrl {
    // Get the host header to determine where to redirect the user to.
    // This should be the base for one of the identity provider's redirect
    // paths.
    let address: &str = req
        .headers()
        .get(HOST)
        .expect("Could not get host header from request.")
        .to_str()
        .expect("Host request header is not ascii characters");

    // Create and return redirect URL.
    return RedirectUrl::new(format!("https://{}{}", address, redir_path))
        .expect("Could not create redirect URL");
}
/// Function to create the redirect URL for a given request and identity provider's
/// redirect path.
Function to create the redirect URL for a given request and identity provider's
redirect path.
Function to create the redirect URL for a given request and identity provider ' s redirect path .
fn make_redirect_url(req: &HttpRequest, redir_path: String) -> RedirectUrl {
    // Get the host header to determine where to redirect the user to.
    // This should be the base for one of the identity provider's redirect
    // paths.
    let address: &str = req
        .headers()
        .get(HOST)
        .expect("Could not get host header from request.")
        .to_str()
        .expect("Host request header is not ascii characters");
    // Create and return redirect URL.
    return RedirectUrl::new(format!("https://{}{}", address, redir_path))
        .expect("Could not create redirect URL");
}
fn make_redirect_url ( req : & HttpRequest , redir_path : String ) -> RedirectUrl { // Get the host header to determine where to redirect the user to. // This should be the base for one of the identity provider's redirect // paths. let address : & str = req . headers ( ) . get ( HOST ) . expect ( " " ) . to_str ( ) . expect ( " " ) ; // Create and return redirect URL. return RedirectUrl :: new ( format ! ( " " address redir_path ) ) . expect ( " " ) ; }
Function to create the redirect URL for a given request and identity provider's
redirect path.
Function to create the redirect URL for a given request and identity provider ' s redirect path .
req
&HttpRequest
redir_path
String
req
&HttpRequest
redir_path
String