pub fn should_deny_url(url: &Url, handles: Arc<Handles>) -> Result<bool> {
    log::trace!(
        "enter: should_deny_url({}, {:?}, {:?})",
        url.as_str(),
        handles.config.url_denylist,
        handles.ferox_scans()?
    );

    // normalization for comparison is to remove the trailing / if one exists, this is done for
    // the given url and any url to which it's compared
    let normed_url = Url::parse(url.to_string().trim_end_matches('/'))?;

    for denier in &handles.config.url_denylist {
        // note to self: it may seem as though we can use regex only for --dont-scan, however, in
        // doing so, we lose the ability to block a parent directory while scanning a child
        if let Ok(should_deny) = should_deny_absolute(&normed_url, denier, handles.clone()) {
            if should_deny {
                return Ok(true);
            }
        }
    }

    for denier in &handles.config.regex_denylist {
        if should_deny_regex(&normed_url, denier) {
            return Ok(true);
        }
    }

    // made it to the end of the deny lists unscathed, return false, indicating we should not deny
    // this particular url
    log::trace!("exit: should_deny_url -> false");
    Ok(false)
}
/// determines whether or not a given url should be denied based on the user-supplied --dont-scan
/// flag
determines whether or not a given url should be denied based on the user-supplied --dont-scan
flag
determines whether or not a given url should be denied based on the user - supplied -- dont - scan flag
pub fn should_deny_url(url: &Url, handles: Arc<Handles>) -> Result<bool> {
    log::trace!(
        "enter: should_deny_url({}, {:?}, {:?})",
        url.as_str(),
        handles.config.url_denylist,
        handles.ferox_scans()?
    );
    // normalization for comparison is to remove the trailing / if one exists, this is done for
    // the given url and any url to which it's compared
    let normed_url = Url::parse(url.to_string().trim_end_matches('/'))?;
    for denier in &handles.config.url_denylist {
        // note to self: it may seem as though we can use regex only for --dont-scan, however, in
        // doing so, we lose the ability to block a parent directory while scanning a child
        if let Ok(should_deny) = should_deny_absolute(&normed_url, denier, handles.clone()) {
            if should_deny {
                return Ok(true);
            }
        }
    }
    for denier in &handles.config.regex_denylist {
        if should_deny_regex(&normed_url, denier) {
            return Ok(true);
        }
    }
    // made it to the end of the deny lists unscathed, return false, indicating we should not deny
    // this particular url
    log::trace!("exit: should_deny_url -> false");
    Ok(false)
}
pub fn should_deny_url ( url : & Url , handles : Arc < Handles > ) -> Result < bool > { log :: trace ! ( " " url as_str ( ) handles config url_denylist handles ferox_scans ( ) ) ; // normalization for comparison is to remove the trailing / if one exists, this is done for // the given url and any url to which it's compared let normed_url = Url :: parse ( url . to_string ( ) . trim_end_matches ( '/' ) ) ? ; for denier in & handles . config . url_denylist { // note to self: it may seem as though we can use regex only for --dont-scan, however, in // doing so, we lose the ability to block a parent directory while scanning a child if let Ok ( should_deny ) = should_deny_absolute ( & normed_url , denier , handles . clone ( ) ) { if should_deny { return Ok ( true ) ; } } } for denier in & handles . config . regex_denylist { if should_deny_regex ( & normed_url , denier ) { return Ok ( true ) ; } } // made it to the end of the deny lists unscathed, return false, indicating we should not deny // this particular url log :: trace ! ( " " ) ; Ok ( false ) }
determines whether or not a given url should be denied based on the user-supplied --dont-scan
flag
determines whether or not a given url should be denied based on the user - supplied -- dont - scan flag
url
&Url
handles
Arc<Handles>