1
0
mirror of https://gitlab.com/Anson-Projects/zine.git synced 2025-06-15 13:16:39 +00:00

check main_url for validity

This commit is contained in:
Anson Biggs 2024-05-31 23:19:47 -06:00
parent 310f3d7f6a
commit 015a1a7f19

View File

@ -247,7 +247,13 @@ pub fn validate(post: &mut Post) {
if !is_valid_url(post.link.as_str()) {
post.score = 0;
println!("{} is not valid", post.link.as_str());
println!("post link {} is not valid", post.link.as_str());
return;
};
if !is_valid_url(&("http://".to_owned() + post.main_url.as_str())) {
post.score = 0;
println!("main_url {} is not valid", post.main_url.as_str());
return;
};