Skip to content

Commit

Permalink
Merge pull request #1 from samuelba/fix/use-longest-match-for-stream
Browse files Browse the repository at this point in the history
use 'longest_match' with stream
  • Loading branch information
samuelba authored Apr 7, 2023
2 parents 40cd002 + 3d69296 commit ed83b96
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "traefik_crowdsec_bouncer"
version = "0.2.1"
version = "0.2.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion src/bouncer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub async fn authenticate(
let req_ip = Ipv4Addr::from_str(&req_ip_str);
match req_ip {
Ok(ip) => {
if ipv4_table.exact_match(ip, 32).is_some() {
if ipv4_table.longest_match(ip).is_some() {
forbidden_response(Some(req_ip_str))
} else {
allowed_response(Some(req_ip_str))
Expand Down
2 changes: 1 addition & 1 deletion src/crowdsec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use ip_network_table_deps_treebitmap::IpLookupTable;
use serde::{Deserialize, Serialize};

use crate::config::Config;
use crate::errors::{CrowdSecApiError};
use crate::errors::CrowdSecApiError;
use crate::types::{CacheAttributes, HealthStatus};
use crate::utils::get_ip_and_subnet;

Expand Down

0 comments on commit ed83b96

Please sign in to comment.