diff --git a/src/api/xrpc/request_crawl.rs b/src/api/xrpc/request_crawl.rs index c52d0be..3384c70 100644 --- a/src/api/xrpc/request_crawl.rs +++ b/src/api/xrpc/request_crawl.rs @@ -14,6 +14,15 @@ pub async fn handle( let url_str = format!("wss://{}/", req.hostname); let url = Url::parse(&url_str).map_err(|e| bad_request(nsid, e))?; + if hydrant.pds.is_banned(&req.hostname) { + return Err(XrpcErrorResponse { + status: StatusCode::BAD_REQUEST, + error: jacquard_common::xrpc::XrpcError::Xrpc(RequestCrawlError::HostBanned(Some( + "host is banned".into(), + ))), + }); + } + hydrant .firehose .add_source(url, true)