Skip to content

Commit

Permalink
added filter for http and example.com
Browse files Browse the repository at this point in the history
  • Loading branch information
0xMimir committed Oct 16, 2023
1 parent 0789bd2 commit e782ce4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,18 @@ impl Brokr {
.into_iter()
.filter_map(|link| link.as_str().parse().ok())
.filter(|url: &Url| {
// We only test http
if url.scheme() != "https" && url.scheme() != "http" {
return false;
}

let host = url.host_str();

!filter_localhost
|| !(host == Some("localhost")
|| host == Some("127.0.0.1")
|| host == Some("0.0.0.0"))
|| host == Some("0.0.0.0")
|| host == Some("example.com"))
})
.collect();

Expand Down

0 comments on commit e782ce4

Please sign in to comment.