pub async fn request_links(&self, links: HashSet<String>) -> Result<()> {
        log::trace!("enter: request_links({:?})", links);
        let recursive = if self.handles.config.no_recursion {
            RecursionStatus::NotRecursive
        } else {
            RecursionStatus::Recursive
        };

        let scanned_urls = self.handles.ferox_scans()?;

        for link in links {
            let mut resp = match self.request_link(&link).await {
                Ok(resp) => resp,
                Err(_) => continue,
            };

            // filter if necessary
            if self
                .handles
                .filters
                .data
                .should_filter_response(&resp, self.handles.stats.tx.clone())
            {
                continue;
            }

            if resp.is_file() {
                // very likely a file, simply request and report
                log::debug!("Extracted file: {}", resp);

                scanned_urls.add_file_scan(&resp.url().to_string(), ScanOrder::Latest);

                if let Err(e) = resp.send_report(self.handles.output.tx.clone()) {
                    log::warn!("Could not send FeroxResponse to output handler: {}", e);
                }

                continue;
            }

            if matches!(recursive, RecursionStatus::Recursive) {
                log::debug!("Extracted Directory: {}", resp);

                if !resp.url().as_str().ends_with('/')
                    && (resp.status().is_success()
                        || matches!(resp.status(), &StatusCode::FORBIDDEN))
                {
                    // if the url doesn't end with a /
                    // and the response code is either a 2xx or 403

                    // since all of these are 2xx or 403, recursion is only attempted if the
                    // url ends in a /. I am actually ok with adding the slash and not
                    // adding it, as both have merit.  Leaving it in for now to see how
                    // things turn out (current as of: v1.1.0)
                    resp.set_url(&format!("{}/", resp.url()));
                }

                self.handles
                    .send_scan_command(Command::TryRecursion(Box::new(resp)))?;
                let (tx, rx) = oneshot::channel::<bool>();
                self.handles.send_scan_command(Command::Sync(tx))?;
                rx.await?;
            }
        }
        log::trace!("exit: request_links");
        Ok(())
    }
/// given a set of links from a normal http body response, task the request handler to make
/// the requests
given a set of links from a normal http body response, task the request handler to make
the requests
given a set of links from a normal http body response task the request handler to make the requests
pub async fn request_links(&self, links: HashSet<String>) -> Result<()> {
        log::trace!("enter: request_links({:?})", links);
        let recursive = if self.handles.config.no_recursion {
            RecursionStatus::NotRecursive
        } else {
            RecursionStatus::Recursive
        };
        let scanned_urls = self.handles.ferox_scans()?;
        for link in links {
            let mut resp = match self.request_link(&link).await {
                Ok(resp) => resp,
                Err(_) => continue,
            };
            // filter if necessary
            if self
                .handles
                .filters
                .data
                .should_filter_response(&resp, self.handles.stats.tx.clone())
            {
                continue;
            }
            if resp.is_file() {
                // very likely a file, simply request and report
                log::debug!("Extracted file: {}", resp);
                scanned_urls.add_file_scan(&resp.url().to_string(), ScanOrder::Latest);
                if let Err(e) = resp.send_report(self.handles.output.tx.clone()) {
                    log::warn!("Could not send FeroxResponse to output handler: {}", e);
                }
                continue;
            }
            if matches!(recursive, RecursionStatus::Recursive) {
                log::debug!("Extracted Directory: {}", resp);
                if !resp.url().as_str().ends_with('/')
                    && (resp.status().is_success()
                        || matches!(resp.status(), &StatusCode::FORBIDDEN))
                {
                    // if the url doesn't end with a /
                    // and the response code is either a 2xx or 403
                    // since all of these are 2xx or 403, recursion is only attempted if the
                    // url ends in a /. I am actually ok with adding the slash and not
                    // adding it, as both have merit.  Leaving it in for now to see how
                    // things turn out (current as of: v1.1.0)
                    resp.set_url(&format!("{}/", resp.url()));
                }
                self.handles
                    .send_scan_command(Command::TryRecursion(Box::new(resp)))?;
                let (tx, rx) = oneshot::channel::<bool>();
                self.handles.send_scan_command(Command::Sync(tx))?;
                rx.await?;
            }
        }
        log::trace!("exit: request_links");
        Ok(())
    }
pub async fn request_links ( & self , links : HashSet < String > ) -> Result < ( ) > { log :: trace ! ( " " links ) ; let recursive = if self . handles . config . no_recursion { RecursionStatus :: NotRecursive } else { RecursionStatus :: Recursive } ; let scanned_urls = self . handles . ferox_scans ( ) ? ; for link in links { let mut resp = match self . request_link ( & link ) . await { Ok ( resp ) => resp , Err ( _ ) => continue , } ; // filter if necessary if self . handles . filters . data . should_filter_response ( & resp , self . handles . stats . tx . clone ( ) ) { continue ; } if resp . is_file ( ) { // very likely a file, simply request and report log :: debug ! ( " " resp ) ; scanned_urls . add_file_scan ( & resp . url ( ) . to_string ( ) , ScanOrder :: Latest ) ; if let Err ( e ) = resp . send_report ( self . handles . output . tx . clone ( ) ) { log :: warn ! ( " " e ) ; } continue ; } if matches ! ( recursive RecursionStatus Recursive ) { log :: debug ! ( " " resp ) ; if ! resp . url ( ) . as_str ( ) . ends_with ( '/' ) && ( resp . status ( ) . is_success ( ) || matches ! ( resp status ( ) StatusCode FORBIDDEN ) ) { // if the url doesn't end with a / // and the response code is either a 2xx or 403 // since all of these are 2xx or 403, recursion is only attempted if the // url ends in a /. I am actually ok with adding the slash and not // adding it, as both have merit.  Leaving it in for now to see how // things turn out (current as of: v1.1.0) resp . set_url ( & format ! ( " " resp url ( ) ) ) ; } self . handles . send_scan_command ( Command :: TryRecursion ( Box :: new ( resp ) ) ) ? ; let ( tx , rx ) = oneshot :: channel :: < bool > ( ) ; self . handles . send_scan_command ( Command :: Sync ( tx ) ) ? ; rx . await ? ; } } log :: trace ! ( " " ) ; Ok ( ( ) ) }
given a set of links from a normal http body response, task the request handler to make
the requests
given a set of links from a normal http body response task the request handler to make the requests
&self
links
HashSet<String>