mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-27 00:25:10 +00:00
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)
This commit is contained in:
parent
f4a2763038
commit
4c6ea4ebcb
1 changed files with 11 additions and 2 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue