Skip to content

Commit

Permalink
Allow lowercase of MMDB region name.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuguorui committed Apr 19, 2022
1 parent 9bd1b2b commit 5f19739
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl Condition {
if let Ok(region) = region {
if self
.maxmind_regions
.contains(&region.country.unwrap().iso_code.unwrap().to_string())
.contains(&region.country.unwrap().iso_code.unwrap().to_string().to_lowercase())
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ fn parse_route_rules(s: &mut Config, route: &mut RouteTable) -> Result<(), Confi
name if name.ends_with(".mmdb") => {
let maxmind_reader = maxminddb::Reader::open_readfile(filename).unwrap();
route.ip_db = Some(maxmind_reader);
cond.maxmind_regions.push(region.to_string());
cond.maxmind_regions.push(region.to_string().to_lowercase());
}
name if name.ends_with(".dat") => {
let mut f = std::fs::File::open(filename)
Expand Down

0 comments on commit 5f19739

Please sign in to comment.