fix 2 electric boogaloo
This commit is contained in:
@@ -8,13 +8,13 @@ use crate::util::requester::Requester;
|
|||||||
|
|
||||||
fn normalize_image_url(endpoint: &str) -> String {
|
fn normalize_image_url(endpoint: &str) -> String {
|
||||||
let endpoint = endpoint.trim_start_matches('/');
|
let endpoint = endpoint.trim_start_matches('/');
|
||||||
|
println!("Normalizing image URL: {endpoint}");
|
||||||
if endpoint.starts_with("http://") || endpoint.starts_with("https://") {
|
if endpoint.starts_with("http://") || endpoint.starts_with("https://") {
|
||||||
endpoint.to_string()
|
endpoint.to_string()
|
||||||
} else if endpoint.starts_with("hanime-cdn.com/") || endpoint == "hanime-cdn.com" {
|
} else if endpoint.starts_with("hanime-cdn.com/") || endpoint == "hanime-cdn.com" {
|
||||||
format!("https://{endpoint}")
|
format!("https://{endpoint}")
|
||||||
} else {
|
} else {
|
||||||
format!("https://hanime-cdn.com/{endpoint}")
|
format!("https://{endpoint}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user