test(agent): Add unit tests for agent-core and fix clippy warnings
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user