From 4c6ea4ebcb8f34fc8a83c176afaea5843dd9e9ec Mon Sep 17 00:00:00 2001 From: Reuven Date: Tue, 17 Mar 2026 02:14:46 -0400 Subject: [PATCH] fix(adr-115): add Accept and Connection headers for CDX requests Try adding HTTP headers that might help with server compatibility: - Accept: application/json - Connection: close (avoid keep-alive issues) --- crates/mcp-brain-server/src/pipeline.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/mcp-brain-server/src/pipeline.rs b/crates/mcp-brain-server/src/pipeline.rs index 81aa8805..acecbd17 100644 --- a/crates/mcp-brain-server/src/pipeline.rs +++ b/crates/mcp-brain-server/src/pipeline.rs @@ -644,7 +644,12 @@ impl CommonCrawlAdapter { tokio::time::sleep(delay).await; } - match self.http.get(&url).send().await { + // Add headers that might help with compatibility + match self.http.get(&url) + .header("Accept", "application/json") + .header("Connection", "close") + .send().await + { Ok(resp) => { let status = resp.status().as_u16(); match resp.text().await { @@ -744,7 +749,11 @@ impl CommonCrawlAdapter { tokio::time::sleep(delay).await; } - match self.http.get(&url).send().await { + match self.http.get(&url) + .header("Accept", "application/json") + .header("Connection", "close") + .send().await + { Ok(resp) => { if !resp.status().is_success() { last_error = format!("CDX returned status {}", resp.status());