fn check_http_url(url: &Url, ctx: &CheckContext) -> bool {
    if !ctx.check_http {
        debug!(
            "Skip checking {} as checking of http URLs is turned off",
            url
        );
        return true;
    }

    for blacklisted_prefix in PREFIX_BLACKLIST.iter() {
        if url.as_str().starts_with(blacklisted_prefix) {
            debug!(
                "Skip checking {} as URL prefix is on the builtin blacklist",
                url
            );
            return true;
        }
    }

    let resp = reqwest::get(url.as_str());
    match resp {
        Ok(r) => r.status() == StatusCode::Ok,
        Err(e) => {
            error!("Error fetching {}: {}", url, e);
            false
        }
    }
}
/// Check a URL with "http" or "https" scheme for availability. Returns `false` if it is unavailable.
Check a URL with "http" or "https" scheme for availability. Returns `false` if it is unavailable.
Check a URL with " http " or " https " scheme for availability . Returns ` false ` if it is unavailable .
fn check_http_url(url: &Url, ctx: &CheckContext) -> bool {
    if !ctx.check_http {
        debug!(
            "Skip checking {} as checking of http URLs is turned off",
            url
        );
        return true;
    }
    for blacklisted_prefix in PREFIX_BLACKLIST.iter() {
        if url.as_str().starts_with(blacklisted_prefix) {
            debug!(
                "Skip checking {} as URL prefix is on the builtin blacklist",
                url
            );
            return true;
        }
    }
    let resp = reqwest::get(url.as_str());
    match resp {
        Ok(r) => r.status() == StatusCode::Ok,
        Err(e) => {
            error!("Error fetching {}: {}", url, e);
            false
        }
    }
}
fn check_http_url ( url : & Url , ctx : & CheckContext ) -> bool { if ! ctx . check_http { debug ! ( " " url ) ; return true ; } for blacklisted_prefix in PREFIX_BLACKLIST . iter ( ) { if url . as_str ( ) . starts_with ( blacklisted_prefix ) { debug ! ( " " url ) ; return true ; } } let resp = reqwest :: get ( url . as_str ( ) ) ; match resp { Ok ( r ) => r . status ( ) == StatusCode :: Ok , Err ( e ) => { error ! ( " " url e ) ; false } } }
Check a URL with "http" or "https" scheme for availability.
Check a URL with " http " or " https " scheme for availability .
url
&Url
ctx
&CheckContext