test(agent): Add unit tests for agent-core and fix clippy warnings

This commit is contained in:
2025-12-26 18:19:58 +01:00
parent fbb6681cd2
commit f5a5724823
14 changed files with 322 additions and 120 deletions

View File

@@ -82,9 +82,10 @@ impl WebFetchClient {
let status = response.status().as_u16();
// Handle redirects manually
if status >= 300 && status < 400 {
if let Some(location) = response.headers().get("location") {
let location_str = location.to_str()?;
if (300..400).contains(&status)
&& let Some(location) = response.headers().get("location")
{
let location_str = location.to_str()?;
// Parse the redirect URL (may be relative)
let redirect_url = if location_str.starts_with("http") {
@@ -111,7 +112,6 @@ impl WebFetchClient {
url,
redirect_url
));
}
}
let content_type = response