From 064ef9141748928490d27ff0e749c7c75a67387b Mon Sep 17 00:00:00 2001 From: dawn <90008@gaze.systems> Date: Thu, 2 Apr 2026 21:40:01 +0300 Subject: [PATCH] [api] actually reject banned pds in requestCrawl --- src/api/xrpc/request_crawl.rs | 9 +++++++++ 1 file changed, 9 insertions(+) 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) -- 2.51.2